Box.PoolProcessor (box v0.15.1)
View SourceStarts a pool processor that runs jobs concurrently
Examples
iex> Box.PoolProcessor.start_link(name: MyPool, size: 10)
{:ok, pid}
iex> Box.PoolProcessor.async(MyPool, fn -> IO.inspect("Hello") end)
:ok
Summary
Functions
Enqueues a function call in the pool asynchronously
Returns a specification to start this module under a supervisor.
Starts a child in the pool supervisor
Starts a pool supervisor
Enqueues a function call and awaits for it to be completed.
Types
Functions
@spec async(pool_supervisor(), execute_function()) :: :ok
Enqueues a function call in the pool asynchronously
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec start_child(pool_supervisor(), execute_function()) :: {:ok, pid()}
Starts a child in the pool supervisor
@spec start_link([option()]) :: Supervisor.on_start_child()
Starts a pool supervisor
@spec sync(pool_supervisor(), execute_function(), non_neg_integer()) :: :ok
Enqueues a function call and awaits for it to be completed.