Skip to content

Is there an async version of nats::jetstream? #194

@pashinin

Description

@pashinin

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions