You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just implemented message batching in TopicProducer in 182d450 and I have found that using it can be a bit tricky. calling send() on a prducer returns a future of CommandSendReceipt. When batching, that future will not resolved until the batch has been sent, so we cannot do producer.send(...).await in a loop, as is done in the round trip example, because we would be stuck at the first send()https://github.com/wyyerd/pulsar-rs/blob/182d45071c02e6f5885dcfa8293bd2a299178d6c/examples/round_trip.rs#L74-L81
Instead, we need to collect the receipt futures, and await on them all at once:
I just implemented message batching in
TopicProducer
in 182d450 and I have found that using it can be a bit tricky. callingsend()
on a prducer returns a future ofCommandSendReceipt
. When batching, that future will not resolved until the batch has been sent, so we cannot doproducer.send(...).await
in a loop, as is done in the round trip example, because we would be stuck at the firstsend()
https://github.com/wyyerd/pulsar-rs/blob/182d45071c02e6f5885dcfa8293bd2a299178d6c/examples/round_trip.rs#L74-L81Instead, we need to collect the receipt futures, and await on them all at once:
Maybe there's a better way to represent this in the API?
The text was updated successfully, but these errors were encountered: