updated README

This commit is contained in:
Thiago Holanda 2018-03-12 20:40:57 +01:00
parent 5a4f2c6d77
commit e610cb2db3
No known key found for this signature in database
GPG Key ID: F94B6756E6B6D57A
1 changed files with 21 additions and 35 deletions

View File

@ -1,14 +1,10 @@
# ZeroMQ # ZeroMQKit
[![Swift][swift-badge]][swift-url] [![Swift][swift-badge]][swift-url]
[![Zewo][zewo-badge]][zewo-url]
[![Platform][platform-badge]][platform-url] [![Platform][platform-badge]][platform-url]
[![License][mit-badge]][mit-url] [![License][mit-badge]][mit-url]
[![Slack][slack-badge]][slack-url]
[![Travis][travis-badge]][travis-url]
[![Codebeat][codebeat-badge]][codebeat-url]
**ZeroMQ** is a [0mq](http://zeromq.org/) binding for **Swift 3**. **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 ## Features
@ -21,21 +17,26 @@
##Example ##Example
```swift ```swift
import ZeroMQ import ZeroMQKit
let context = try Context() guard let context = try? Context() else {
fatalError("Context could not be instantiated")
}
let inbound = try context.socket(.Pull) guard let inbound = try? context.socket(.pull) else {
try inbound.bind("tcp://127.0.0.1:5555") fatalError("Cannot create socket to .pull")
}
try? inbound.bind("tcp://127.0.0.1:5555")
let outbound = try context.socket(.Push) if let outbound = try? context.socket(.push) {
try outbound.connect("tcp://127.0.0.1:5555") try outbound.connect("tcp://127.0.0.1:5555")
try outbound.sendString("Hello World!") _ = try outbound.send("Hello World!")
try outbound.sendString("Bye!") _ = try outbound.send("Bye!")
}
while let data = try inbound.receiveString() where data != "Bye!" { while let data = try? inbound.receive(), let value = data, value != "Bye!" {
print(data) // "Hello World!" print(value) // "Hello World!"
} }
``` ```
@ -54,37 +55,22 @@ import PackageDescription
let package = Package( let package = Package(
dependencies: [ dependencies: [
.Package(url: "https://github.com/Zewo/ZeroMQ.git", majorVersion: 0, minor: 5), .package(url: "https://github.com/unnamedd/ZeroMQ.git", .upToNextMajor(from: "1.0.0")),
] ]
) )
``` ```
## Support ## Support
If you need any help you can join our [Slack](http://slack.zewo.io) 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. 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.
## Community
[![Slack][slack-image]][slack-url]
The entire Zewo code base is licensed under MIT. By contributing to Zewo you are contributing to an open and engaged community of brilliant Swift programmers. Join us on [Slack](http://slack.zewo.io) to get to know us!
## License ## License
This project is released under the MIT license. See [LICENSE](LICENSE) for details. This project is released under the MIT license. See [LICENSE](LICENSE) for details.
[swift-badge]: https://img.shields.io/badge/Swift-3.0-orange.svg?style=flat [swift-badge]: https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat
[swift-url]: https://swift.org [swift-url]: https://swift.org
[zewo-badge]: https://img.shields.io/badge/Zewo-0.5-FF7565.svg?style=flat
[zewo-url]: http://zewo.io
[platform-badge]: https://img.shields.io/badge/Platforms-OS%20X%20--%20Linux-lightgray.svg?style=flat [platform-badge]: https://img.shields.io/badge/Platforms-OS%20X%20--%20Linux-lightgray.svg?style=flat
[platform-url]: https://swift.org [platform-url]: https://swift.org
[mit-badge]: https://img.shields.io/badge/License-MIT-blue.svg?style=flat [mit-badge]: https://img.shields.io/badge/License-MIT-blue.svg?style=flat
[mit-url]: https://tldrlegal.com/license/mit-license [mit-url]: https://tldrlegal.com/license/mit-license
[slack-image]: http://s13.postimg.org/ybwy92ktf/Slack.png
[slack-badge]: https://zewo-slackin.herokuapp.com/badge.svg
[slack-url]: http://slack.zewo.io
[travis-badge]: https://travis-ci.org/Zewo/ZeroMQ.svg?branch=master
[travis-url]: https://travis-ci.org/Zewo/ZeroMQ
[codebeat-badge]: https://codebeat.co/badges/baad8b1a-7649-496b-b224-ce59b33a1717
[codebeat-url]: https://codebeat.co/projects/github-com-zewo-zeromq