I want to do something like:
...
tokio::select! {
res = consumer.pull() => {
let msg = res.unwrap();
tokio::spawn(async move {
println!("got message {:?}", msg.data);
msg.ack().unwrap();
});
}
_ = shutdown_signal() => {
info!("shutting down worker");
}
}
...
But I cant do this because it is not async.
Or how can I catch SIGINT while waiting for a message?