View Source Queue (fnord v0.4.13)

A module that implements a process pool using a GenServer.

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Waits until the queue is empty and all workers have exited.

Queues an Enum of jobs, executes them, and returns the results in order.

Adds a job to the queue and returns a Task.

Shuts down the queue, preventing new jobs from being added.

Starts the Queue with the given callback function and maximum number of workers. Returns {:ok, pid}

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Callback implementation for GenServer.init/1.

Waits until the queue is empty and all workers have exited.

Queues an Enum of jobs, executes them, and returns the results in order.

Adds a job to the queue and returns a Task.

Shuts down the queue, preventing new jobs from being added.

Link to this function

start_link(max_workers, callback)

View Source

Starts the Queue with the given callback function and maximum number of workers. Returns {:ok, pid}