pulsar4s
pulsar4s copied to clipboard
SendAsync
(I apologize for this question as I am a beginner to scala)
Is there an example anywhere on how to use sendAsync?
I am trying to do the following:
if sCol is a collection on strings
Then I would like to do
sCol.map(producer.sendAsync(_))
wait until all complete
Or does the default send use batching without waiting?
If I just do sCol.map(producer.send(_)), then it is terribly slow so I do not think the messages are being batched
Your last example will send one at a time. You can sendAsync then collect all the futures using .sequence and then await on that.