View Source Queue (fnord v0.4.34)

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

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

init(arg)

Callback implementation for GenServer.init/1.

join(pid)

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

map(enum, pid)

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

queue(pid, args)

Adds a job to the queue and returns a Task.

shutdown(pid)

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

start_link(callback)

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