LDSwiftEventSource is a cross platform implementation of the EventSource specification written in Swift. It was developed for use in the LaunchDarkly iOS SDK. Generated API docs are available on GitHub Pages.
To use the CocoaPods dependency manager to integrate LDSwiftEventSource into your Xcode project, specify it in your
pod 'LDSwiftEventSource', '~> 1.2'
To use the Carthage dependency manager to integrate LDSwiftEventSource into your Xcode project, specify it in your
github "LaunchDarkly/swift-eventsource" ~> 1.2
The Swift Package Manager is a dependency manager integrated into the
swift compiler and Xcode. Note that the LDSwiftEventSource Swift package provides both a
LDSwiftEventSource product, which is explicitly dynamic, and a
LDSwiftEventSourceStatic product which is explicitly static.
To integrate LDSwiftEventSource into an Xcode project, go to the project editor, and select
Swift Packages. From here hit the
+ button and follow the prompts using
https://github.com/LaunchDarkly/swift-eventsource.git as the URL.
To include LDSwiftEventSource in a Swift package, simply add it to the dependencies section of your
Package.swift file. And add the desired product as a dependency for your targets.
dependencies: [ .package(url: "https://github.com/LaunchDarkly/swift-eventsource.git", .upToNextMajor(from: "1.2.0")) ]
We encourage pull requests and other contributions from the community. Check out our contributing guidelines for instructions on how to contribute to this SDK.
|Last commit: 3 weeks ago|
backoffResetThresholdprior to the scheduling of a reconnection attempt. The connection backoff has been corrected to not reset after the first reconnection attempt until the next successful connection. Thanks to @tomasf for the PR (#14).
connectionErrorHandlerwould be called twice, the second time with a
URLError.cancellederror. Only if the second call returned
EventSourceclient actually shutdown. This has been corrected to only call the
connectionErrorHandleronce, and will shutdown the client if
ConnectionErrorAction.shutdownis returned. Thanks to @tomasf for the PR (#13).
EventSourceclient to restart after shutting down has been fixed.