Swiftpack.co - shtrihstr/EventHub as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by shtrihstr.
shtrihstr/EventHub 0.1.0
iOS client-side library for EventHub written in Swift
⭐️ 1
🕓 3 years ago
iOS
.package(url: "https://github.com/shtrihstr/EventHub.git", from: "0.1.0")

Swift EventHub Client

iOS client-side library for EventHub written in Swift.

Features

  • Keeps connection only if an active subscription exists
  • Automatic reconnect and resubscribe
  • Concurrent subscriptions to one topic

Usage

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)
   })

Requirements

iOS 13+

Installation

Swift Package Manager

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"))
]

GitHub

link
Stars: 1
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics