Latest 0.1.0
Homepage https://github.com/banjun/ReactiveSSE
License MIT
Platforms ios 10.0, osx 10.12
Dependencies ReactiveSwift, FootlessParser
Authors

CI Status
Version
License
Platform

ReactiveSSE is a ReactiveSwift.SignalProducer acting as Server-Sent Events (SSE) parser.
https://www.w3.org/TR/eventsource/

SSE stream is buffered and parsed in a background queue and can be observed via its signal.

Usage

let sse = ReactiveSSE(urlRequest: URLRequest(url: URL(string: endpoint)!))
sse.producer.observe(on: QueueScheduler.main).startWithValues { (v: SSEvent) in
    v.type // String: "message", "update", or whatever
    v.data // String: json payload string, any value string, or whatever
}

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

ReactiveSSE is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'ReactiveSSE'

Author

@banjun

License

ReactiveSSE is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ReactiveSSE",
    "version": "0.1.0",
    "summary": "Server Sent Events (SSE) parser operators for ReactiveSwift",
    "description": "Server Sent Events (SSE) parser operators for ReactiveSwift.nYou can observe event streams sent via Server Sent Events (SSE).",
    "homepage": "https://github.com/banjun/ReactiveSSE",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "banjun": "[email protected]"
    },
    "source": {
        "git": "https://github.com/banjun/ReactiveSSE.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/banjun",
    "platforms": {
        "ios": "10.0",
        "osx": "10.12"
    },
    "source_files": "ReactiveSSE/Classes/**/*",
    "dependencies": {
        "ReactiveSwift": [
            "~> 3.0"
        ],
        "FootlessParser": [
            "~> 0.4"
        ]
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This