cloudamqp / amqp-client.cr

An AMQP 0-9-1 client for Crystal
https://cloudamqp.github.io/amqp-client.cr/
MIT License
69 stars 10 forks source link

Wait for all confirms #38

Closed baelter closed 1 year ago

baelter commented 1 year ago

Reopened #37

chadknutson commented 1 year ago

I get a compile error when trying to use this branch in the deprecated on_confirm function:

In lib/amqp-client/src/amqp-client/channel.cr:318:83

318 | if _idx = @unconfirmed_publishes.bsearch_index { |confirm_id| confirm_id >= delivery_tag }

Error: undefined local variable or method 'delivery_tag' for AMQP::Client::Channel

baelter commented 1 year ago

Sorted @chadknutson , Thanks for testing :)

carlhoerberg commented 1 year ago

Just make sure to squash before merge

carlhoerberg commented 11 months ago

Hmm, on_confirm(msgid) is kind of useful here: https://github.com/cloudamqp/lavinmq/blob/main/src/lavinmq/shovel/shovel.cr#L228-L230 While wait_for_confirms will cause a big performance hit. Thinking of a way to reintroduce it...

carlhoerberg commented 11 months ago

Thinking if basic_publish_confirm(...) { "this block is called on publish confirm" } is a better API?