Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2817148F1DD7436600F7A8E0"
BuildableName = "EventSource-watchOS.framework"
BuildableName = "EventSource.framework"
BlueprintName = "EventSource-watchOS"
ReferencedContainer = "container:EventSource.xcodeproj">
</BuildableReference>
Expand All @@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -46,13 +44,11 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2817148F1DD7436600F7A8E0"
BuildableName = "EventSource-watchOS.framework"
BuildableName = "EventSource.framework"
BlueprintName = "EventSource-watchOS"
ReferencedContainer = "container:EventSource.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand All @@ -64,7 +60,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2817148F1DD7436600F7A8E0"
BuildableName = "EventSource-watchOS.framework"
BuildableName = "EventSource.framework"
BlueprintName = "EventSource-watchOS"
ReferencedContainer = "container:EventSource.xcodeproj">
</BuildableReference>
Expand Down
25 changes: 5 additions & 20 deletions EventSource/EventSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#import <Foundation/Foundation.h>

typedef enum {
kEventStateConnecting = 0,
kEventStateOpen = 1,
kEventStateClosed = 2,
kEventStateConnecting = 0,
kEventStateOpen = 1,
kEventStateClosed = 2,
} EventState;

// ---------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -42,27 +42,12 @@ typedef void (^EventSourceEventHandler)(Event *event);
/// Connect to and receive Server-Sent Events (SSEs).
@interface EventSource : NSObject

/// Returns a new instance of EventSource with the specified URL.
///
/// @param URL The URL of the EventSource.
+ (instancetype)eventSourceWithURL:(NSURL *)URL;

/// Returns a new instance of EventSource with the specified URL.
///
/// @param URL The URL of the EventSource.
/// @param timeoutInterval The request timeout interval in seconds. See <tt>NSURLRequest</tt> for more details. Default: 5 minutes.
+ (instancetype)eventSourceWithURL:(NSURL *)URL timeoutInterval:(NSTimeInterval)timeoutInterval;

/// Creates a new instance of EventSource with the specified URL.
///
/// @param URL The URL of the EventSource.
- (instancetype)initWithURL:(NSURL *)URL;

/// Creates a new instance of EventSource with the specified URL.
///
/// @param URL The URL of the EventSource.
/// @param authorization HTTP authorization header parameter.
/// @param timeoutInterval The request timeout interval in seconds. See <tt>NSURLRequest</tt> for more details. Default: 5 minutes.
- (instancetype)initWithURL:(NSURL *)URL timeoutInterval:(NSTimeInterval)timeoutInterval;
- (instancetype)initWithURL:(NSURL *)URL authorization:(NSString *)authorization timeoutInterval:(NSTimeInterval)timeoutInterval;

/// Registers an event handler for the Message event.
///
Expand Down
Loading