first commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
use futures::StreamExt;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let nats_client = async_nats::connect("nats://localhost:4222")
|
||||
.await
|
||||
.expect("Error creating nats client");
|
||||
let mut subscriber = nats_client
|
||||
.queue_subscribe("jobs", "download".to_string())
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
// Receive and process messages
|
||||
while let Some(message) = subscriber.next().await {
|
||||
println!("Received message {:?}", message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user