Flock v0.1.0 Flock View Source

Lightweight process registry and forgiving supervisor.

Link to this section Summary

Functions

Makes a synchronous call to a worker in the flock

Sends an asynchronous request to a worker in the flock

Adds a new worker to the flock

Stops a worker in the flock

Link to this section Types

Link to this type worker_module() View Source
worker_module() :: module()
Link to this type worker_name() View Source
worker_name() :: term()
Link to this type worker_spec() View Source
worker_spec() :: {module :: worker_module(), args :: list(), worker_name :: worker_name()}

Link to this section Functions

Link to this function call(name, request) View Source
call(name :: worker_name(), request :: term()) :: any()

Makes a synchronous call to a worker in the flock.

Link to this function cast(name, request) View Source
cast(name :: worker_name(), request :: term()) :: :ok

Sends an asynchronous request to a worker in the flock.

Link to this function start(worker_spec) View Source
start(worker_spec :: worker_spec()) :: :ok | {:error, :already_exists}

Adds a new worker to the flock.

Link to this function stop(name) View Source
stop(name :: worker_name()) :: :ok | {:error, :not_found}

Stops a worker in the flock.