LDSwiftEventSource

repository·main·Indexed 43 days ago

https://github.com/launchdarkly/swift-eventsource

A cross-platform Swift implementation of the EventSource (Server-Sent Events) specification designed for high-performance streaming of events. Supports iOS 15.0+, watchOS 9.0+, tvOS 15.0+, and macOS 12.0+ using Swift 5.1+. Available via CocoaPods, Carthage, and Swift Package Manager.

Tokens
443
Snippets
4
Records
5
Agent score
5%

What's inside LDSwiftEventSource

  1. Install LDSwiftEventSource via Swift Package Manager

    main

    LDSwiftEventSource provides two distinct products: LDSwiftEventSource (explicitly dynamic) and LDSwiftEventSourceStatic (explicitly static).

    Xcode Integration

    1. Open the project editor in Xcode.
    2. Select Swift Packages.
    3. Click the + button.
    4. Use https://github.com/LaunchDarkly/swift-eventsource.git as the repository URL.

    Swift Package Integration

    Add the package to your Package.swift dependencies and include the desired product in your target dependencies.

    dependencies: [
        .package(url: "https://github.com/LaunchDarkly/swift-eventsource.git", .upToNextMajor(from: "3.3.1"))
    ]
  2. Run SSE client contract tests locally

    main

    To verify your SSE client implementation against the cross-platform SSE testing protocol, you can run the contract tests locally using make. This command automatically handles downloading the appropriate version of the test harness tool.

    Ensure you are in the project root directory before executing the command.

    make contract-tests