iOS client-side library for EventHub written in Swift.
- Keeps connection only if an active subscription exists
- Automatic reconnect and resubscribe
- Concurrent subscriptions to one topic
import EventHub
import Combine
let client = EventHub(url: URL(string: "ws://myeventhubserver.com")!, token: "myAuthToken")
let cancellable = client.subscribe(topic: "foo/bar")
.receive(on: RunLoop.main)
.sink(receiveValue: { response in
print(response.message)
})
iOS 13+
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler.
Once you have your Swift package set up, adding EventHub as a dependency is as easy as adding it to the dependencies
value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/shtrihstr/EventHub.git", .upToNextMajor(from: "0.1.0"))
]