rust-rdkafka icon indicating copy to clipboard operation
rust-rdkafka copied to clipboard

Is `recv()` cancel safe?

Open Zarathustra2 opened this issue 3 years ago • 1 comments
trafficstars

I would like to use recv() with tokio::select! but I couldn't find (maybe missed it) whether recv is cancellation safe so I don't loose any kafka messages.

Zarathustra2 avatar Aug 13 '22 21:08 Zarathustra2

Oh it calls https://github.com/fede1024/rust-rdkafka/blob/master/src/consumer/stream_consumer.rs#L289 next from futures::stream::StreamExt::next which is cancel safe, so recv() is also cancel safe.

Should the rust docs be extended for recv() and should it explicitly state that it is cancel safe?

Zarathustra2 avatar Aug 13 '22 21:08 Zarathustra2