diff --git a/examples/consumer.rs b/examples/consumer.rs new file mode 100644 index 0000000..1f28c29 --- /dev/null +++ b/examples/consumer.rs @@ -0,0 +1,12 @@ +use syndicate::{packets, value::Value}; +use tokio::net::TcpStream; +use tokio_util::codec::Framed; +use futures::SinkExt; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let mut frames = Framed::new(TcpStream::connect("127.0.0.1:8001").await?, + packets::Codec::::standard()); + frames.send(packets::In::Connect(Value::from("producer-consumer-example").wrap())).await?; + Ok(()) +}