cody-greene / node-rabbitmq-client

RabbitMQ (0-9-1) client library with auto-reconnect & zero dependencies
MIT License
127 stars 9 forks source link

Allow lazy consumer #51

Closed Zeichen32 closed 5 months ago

Zeichen32 commented 5 months ago

This PR allow to create lazy consumers. As a side effect of this PR, you can now start the consumer again, after you have call close().

Closes #50

Example usage:

const sub = rabbit.createConsumer({
  // ....
  lazy: true
}, async (msg) => {
// ...
})

await sub.start();