hunterloftis / jackrabbit

Simple AMQP / RabbitMQ job queues for node based on amqplib
293 stars 65 forks source link

Fix delayed consume #100

Open Akamaozu opened 5 years ago

Akamaozu commented 5 years ago

Problem: queue.consume does nothing if called after queue emits ready event

Reason: queue.consume always waits for ready event before executing, but ready event emits once

Solution: store ready event in a variable, so queue.consume can determine if it should wait for ready event or execute immediately