https://github.com/banjun/reactivesse
Server Sent Events (SSE) parser operators for ReactiveSwift
https://github.com/banjun/reactivesse
reactiveswift server-sent-events
Last synced: about 2 months ago
JSON representation
Server Sent Events (SSE) parser operators for ReactiveSwift
- Host: GitHub
- URL: https://github.com/banjun/reactivesse
- Owner: banjun
- License: mit
- Created: 2017-11-24T11:59:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-17T06:09:07.000Z (about 3 years ago)
- Last Synced: 2025-11-27T15:11:03.370Z (4 months ago)
- Topics: reactiveswift, server-sent-events
- Language: Swift
- Size: 66.4 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ReactiveSSE

[](http://cocoapods.org/pods/ReactiveSSE)
[](http://cocoapods.org/pods/ReactiveSSE)
[](http://cocoapods.org/pods/ReactiveSSE)
ReactiveSSE is a `ReactiveSwift.SignalProducer` acting as Server-Sent Events (SSE) parser.
SSE stream is buffered and parsed in a background queue and can be observed via its signal.
## Usage
```swift
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](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'ReactiveSSE'
```
## Author
@banjun
## License
ReactiveSSE is available under the MIT license. See the LICENSE file for more info.