Swiftpack.co - Evolution-App/ZeroMQ as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Evolution-App.
Evolution-App/ZeroMQ v0.1
A ZeroMQ library created by our folks from Zewo. The original ->
⭐️ 5
🕓 3 years ago
linux macOS iOS
.package(url: "https://github.com/Evolution-App/ZeroMQ.git", from: "v0.1")

ZeroMQKit

Swift Platform License

ZeroMQKit is a 0mq binding for Swift 4 and this repository is a fork of ZeroMQ.

Features

  • ☑ Context
  • ☑ Socket
  • ☑ Message
  • ☑ Poller
  • ☑ Proxy

Example

import ZeroMQKit

guard let context = try? Context() else {
    fatalError("Context could not be instantiated")
}

guard let inbound = try? context.socket(.pull) else {
    fatalError("Cannot create socket to .pull")
}
try? inbound.bind("tcp://127.0.0.1:5555")

if let outbound = try? context.socket(.push) {
    try outbound.connect("tcp://127.0.0.1:5555")
    
    _ = try outbound.send("Hello World!")
    _ = try outbound.send("Bye!")
}

while let data = try? inbound.receive(), let value = data, value != "Bye!" {
    print(value) // "Hello World!"
}

Installation

Install ZeroMQ system library

./setup_env.sh

Add ZeroMQ to Package.swift

import PackageDescription

let package = Package(
    dependencies: [
        .package(url: "https://github.com/unnamedd/ZeroMQ.git", .upToNextMajor(from: "1.0.0")),
    ]
)

Support

If you need any help you can join on Slack of Zewo and go to the #help channel. Or you can create a Github issue in our main repository. When stating your issue be sure to add enough details, specify what module is causing the problem and reproduction steps.

License

This project is released under the MIT license. See LICENSE for details.

GitHub

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

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