https://github.com/evolution-app/zeromq
A ZeroMQ library created by our folks from Zewo. The original ->
https://github.com/evolution-app/zeromq
macos message-broker message-queue server-side-swift swift swift4 zewo
Last synced: about 1 year ago
JSON representation
A ZeroMQ library created by our folks from Zewo. The original ->
- Host: GitHub
- URL: https://github.com/evolution-app/zeromq
- Owner: EVOlution-App
- License: mit
- Created: 2018-03-12T18:00:06.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-22T21:41:40.000Z (about 6 years ago)
- Last Synced: 2025-04-24T03:47:10.304Z (about 1 year ago)
- Topics: macos, message-broker, message-queue, server-side-swift, swift, swift4, zewo
- Language: Swift
- Homepage: https://github.com/Zewo/ZeroMQ
- Size: 101 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ZeroMQKit
[![Swift][swift-badge]][swift-url]
[![Platform][platform-badge]][platform-url]
[![License][mit-badge]][mit-url]
**ZeroMQKit** is a [0mq](http://zeromq.org/) binding for **Swift 4** and this repository is a fork of [ZeroMQ](https://github.com/Zewo/ZeroMQ).
## Features
- [x] Context
- [x] Socket
- [x] Message
- [x] Poller
- [x] Proxy
## Example
```swift
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
```sh
./setup_env.sh
```
Add `ZeroMQ` to `Package.swift`
```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](http://slack.zewo.io) of Zewo and go to the **#help** channel. Or you can create a Github [issue](https://github.com/Zewo/Zewo/issues/new) 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](LICENSE) for details.
[swift-badge]: https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat
[swift-url]: https://swift.org
[platform-badge]: https://img.shields.io/badge/Platforms-OS%20X%20--%20Linux-lightgray.svg?style=flat
[platform-url]: https://swift.org
[mit-badge]: https://img.shields.io/badge/License-MIT-blue.svg?style=flat
[mit-url]: https://tldrlegal.com/license/mit-license