Skip to content

dclelland/AlamofireEventSource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AlamofireEventSource

Alamofire plugin for Server-Sent Events (SSE).

Usage

import Alamofire
import AlamofireEventSource

let endpoint = URL(string: "http://localhost/sse")!
let request = Session.default.eventSourceRequest(endpoint, lastEventID: "0").responseEventSource { eventSource in
    switch eventSource.event {
    case .message(let message):
        print("Event source received message:", message)
    case .complete(let completion):
        print("Event source completed:", completion)
    }
}

Installation

Ursus can be installed using Cocoapods by adding the following line to your podfile:

`pod 'AlamofireEventSource', '~> 1.2'`

I can probably help set up Carthage or Swift Package Manager support if you need it.

Todo list

Things that would make this codebase nicer:

  • Add support for Combine publishers

Reference

About

Alamofire plugin for Server-Sent Events (SSE)

Resources

License

Stars

Watchers

Forks

Packages

No packages published