Go to file
Thiago Holanda 5ac96bed4d
Remove CZeroMQ as dependency and embed as system library
2020-05-22 23:41:32 +02:00
Sources Remove CZeroMQ as dependency and embed as system library 2020-05-22 23:41:32 +02:00
Tests adapt 3 swift 2016-09-23 20:43:48 +03:00
.gitignore added new rules to .gitignore 2018-03-12 20:29:17 +01:00
.swift-version Minor changes 2020-05-22 21:59:28 +02:00
.travis.yml Fix for missing install-swift.sh travis script 2016-10-28 15:01:56 -04:00
LICENSE init 2015-10-26 01:25:04 -02:00
Package.swift Remove CZeroMQ as dependency and embed as system library 2020-05-22 23:41:32 +02:00
README.md Update README 2019-04-03 22:43:41 +02:00
setup_env.sh Follow redirects 2016-06-05 23:44:59 +02:00

README.md

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.