8000 GitHub - peterjoel/async-zmq: Async version for ZeroMQ bindings
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

peterjoel/async-zmq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Async version for ZeroMQ bindings

This is high-level bindings for zmq in asynchronous manner. Crate itself uses some modules from async-std, but it should also work on any other async reactor. The goal for this project is providing simple interface that is compatible with any async executor and reactor.

TODO list

  • PAIR
  • PUB
  • SUB
  • REQ
  • REP
  • DEALER
  • ROUTER
  • PULL
  • PUSH
  • XPUB
  • XSUB
  • STREAM
  • More tests

Usage

Users could simply initialize any socket type with async_zmq::* in mind, and then call bind() or connect depends on your scenario. For example, if someone wants a publish socket, then he could initialize the socket like this:

let zmq = async_zmq::publish("tcp://127.0.0.1:5555")?.bind();

If there's context need to be shared between different socket, we can set it during building the socket:

let context = Context::new();
let xpub = async_zmq::xpublish("inproc://example")?.with_context(&context).bind();
let sub = subscribe("inproc://example")?.with_context(&context).connect()?;

To learn more about each socket type usage. See modules below.

Prelude

Prelude module provides some common types, traits and their methods. This crate also re-export so it can be easier for you to import them.

Another common issue when people adopting a library is to deal with its error handling flow. To prevent introducing more overhead, async_zmq uses the exact same Result/Error type in zmq crate and re-export them.

About

Async version for ZeroMQ bindings

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%
0