View Source ProcessHub.Worker.WorkerQueue (ProcessHub v0.8.0)

Summary

Functions

Returns a specification to start this module under a supervisor.

Queues fun behind the work already queued, without waiting for it.

Runs fun on the worker queue once the work already queued is done. Called from the queue itself, it runs right away. Waiting longer than timeout exits the caller; fun stays queued and still runs.

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

run_async(worker_queue, fun)

View Source
@spec run_async(GenServer.server(), (-> term())) :: :ok

Queues fun behind the work already queued, without waiting for it.

Link to this function

run_on(worker_queue, fun, timeout \\ :infinity)

View Source
@spec run_on(GenServer.server(), (-> result), timeout()) :: result when result: term()

Runs fun on the worker queue once the work already queued is done. Called from the queue itself, it runs right away. Waiting longer than timeout exits the caller; fun stays queued and still runs.