mirror of
https://github.com/perstarkse/minne.git
synced 2026-04-17 14:39:45 +02:00
init
new file: .aider.chat.history.md
This commit is contained in:
@@ -1,18 +1,9 @@
|
||||
use zettle_db::rabbitmq::RabbitMQ;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let rabbitmq = RabbitMQ::new().await?;
|
||||
let queue_name = rabbitmq.declare_queue("amqprs.examples.basic").await?.0;
|
||||
rabbitmq.bind_queue(&queue_name, "amq.topic", "amqprs.example").await?;
|
||||
|
||||
let mut rx = rabbitmq.consume_messages(&queue_name, "example_consumer").await?;
|
||||
|
||||
println!("Consumer waiting for messages. To exit press CTRL+C");
|
||||
|
||||
while let Some(message) = rx.recv().await {
|
||||
println!("Received message: {}", message);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
#[tokio::main(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn main() {
|
||||
let rabbitmq = RabbitMQ::new().await;
|
||||
let queue_name = rabbitmq.declare_queue("amqprs.examples.basic").await;
|
||||
rabbitmq.bind_queue(&queue_name.0, "amq.topic", "amqprs.example").await;
|
||||
//...
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user