![crates-io-badge]
![docs-badge]
Message brokers which allow for simple communication between Spectacles services.
```rust,norun use std::env::var; use futures::future::Future; use spectacles_brokers::amqp::*;
fn main() { let addr = var("AMQPADDR").expect("No AMQP server address found."); let connect = AmqpBroker::new(addr, "test".tostring(), None); let result = connect.andthen(|broker| { let json = r#"{"message": "Example Publish."}"#.asbytes(); let props = AmqpProperties::default().withcontenttype("application/json".tostring(); broker.publish("HELLO", json.tovec(), props).maperr(|err| { eprintln!("An error was encountered during publish: {}", err); }) }).map(|| { println!("Message publish succeeded, check the other window!"); })
tokio::run(result);
}
```
More examples can be found in the [examples
] directory.