View Source EventStreamex.Operators.Queue (EventStreamex v1.0.0)

Handle the queue of operators to process.

Every event received is dispatched to operators (EventStreamex.Operators.Operator), and executed sequentially to keep ordenancing.

Every time an event is received, a task is added to the queue of events for each operator listening for this event. And everytime a an operator task is finished, it is removed from the queue.

A queue item is a tuple containing the operator module and the event to process.

The queue is handled internally. You should not use it directly.

Summary

Functions

Returns a specification to start this module under a supervisor.

Adds another item to the queue

Retrieves the full queue

Retrieves the current task

Removes all items from the queue.

Tells the queue that the current item is finished.

Functions

Link to this function

child_spec(arg)

View Source (since 1.0.0)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

enqueue(module, event)

View Source (since 1.0.0)

Adds another item to the queue

Link to this function

get_queue()

View Source (since 1.0.0)

Retrieves the full queue

Link to this function

get_task()

View Source (since 1.0.0)

Retrieves the current task

Link to this function

reset_queue()

View Source (since 1.0.0)

Removes all items from the queue.

Should only be used for testing purposes

Link to this function

task_finished()

View Source (since 1.0.0)

Tells the queue that the current item is finished.