質問

I would like some pointers of best practice. I need to wait for a binding to complete before polling for data through it, and much of this happens in parallell all the way back to the client. But if there is already a binding operation in progress, issuing another one will replace the callback.

If I would like to patch node-amqp to support a separate callback for each binding operation, how would I proceed?

役に立ちましたか?

解決

The short answer is that this is not possible in node-amqp. If you call bind on a queue that already has a binding operation in progress, the callback will be replaced. So only one callback will be called for concurrent bindings on the same queue, namely the last one passed.

For this reason, and others, I have switched to using amqp-coffee which handles the binding callback differently.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top