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

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 with each operator listening for this event. And everytime a an operator task is finished, it is update in the queue, until it is deleted completely when all operators have finished their task.

A queue item is a tuple containing the operator modules with their completion status 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 module in the current item has 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(modules, 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(module)

View Source (since 1.2.0)

Tells the queue that the module in the current item has finished.

It will update its completion state, and if all modules have finished the task is completed