Rants
An async NATS client library for the Rust programming language.
Note: Currently, rants
requires a nightly version of the Rust compiler due to its use of async
/await
syntax, but it should work on stable soon!
The client aims to be an ergonomic, yet thin, wrapper over the NATS client protocol. The easiest way to learn to use the client is by reading the NATS client protocol documentation. The main entry point into the library's API is the Client
struct.
Example
use StreamExt;
use Client;
use Runtime;
let main_future = async ;
let runtime = new.expect;
runtime.spawn;
runtime.shutdown_on_idle;
Development
The integration test suite requires the NATS server to be reachable at 127.0.0.1:4222
:
> cargo test
The env_logger
crate is used in integration test. To enable it and run a single test run:
> RUST_LOG=rants=trace cargo test ping_pong
Roadmap
- Increase test coverage
- TLS support
- Explore automatically disconnecting the client when it is dropped
- Support improved request-reply implementation
- Benchmarks and performance