amqp / rhea-promise

A promisified layer over rhea AMQP client
Apache License 2.0
30 stars 19 forks source link

allow changing the drain property in the receiver #14

Closed jfromaniello closed 6 years ago

jfromaniello commented 6 years ago

Rhea supports changing the drain property to true as shown in this example:

https://github.com/amqp/rhea/blob/master/examples/drain.js#L37

amarzavery commented 6 years ago

Thanks for the PR. Can you let me know how do you plan to use the drain property? Some context would help improve my knowledge as well :)

amarzavery commented 6 years ago

0.1.8 version of rhea-promise has been published to npm.

jfromaniello commented 6 years ago

I was trying to follow this example: https://github.com/amqp/rhea/blob/master/examples/drain.js

To be able to subscribe to the drain event. To be honest I am not entirely sure if this is what I want.

I've a receiver, receiving and processing jobs. On SIGTERM I want the receiver to stop receiving new messages and when it finish processing what it has then, close the connection and terminate