ThrottledQueue
Simple throttled queue with live status updates.
This throttled queue performs actions asynchronously and keep the client informed of the status of the enqueued item through its lifecycle.
Installation
def deps do
[
{:throttled_queue, "~> 0.4.0-dev"},
]
endAvailable options:
name: The name of the queue. Defaults toThrottledQueue.max_queue: The maximum capacity of the queue. Defaults to10_000.wait: The throttling time between each dequeue. Defaults to500milliseconds.
Available status updates:
{:dequeued, ref}: The action has been dequeued and is about to be executed.refis the message reference returned byThrottledQueue.enqueue.{:position, ref, position}: The new position in the queue with the message reference.{:result, ref, result}: The result of the action with the message reference.{:error, ref}: An error occured while executing the action.