pub fn create_stream() -> Result<&'static AuroraStreams, Box<dyn Error>>Examples found in repository?
examples/basic.rs (line 15)
14async fn main() -> Result<(), Box<dyn std::error::Error>> {
15 let stream = create_stream().unwrap();
16
17 stream.create_channel(CHANNEL_NAME.to_string()).await?;
18
19 stream
20 .subscribe(CHANNEL_NAME.to_string(), MySubscriber)
21 .await?;
22
23 stream
24 .publish(CHANNEL_NAME.to_string(), "Hello, World!".to_string())
25 .await?;
26
27 tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
28 Ok(())
29}