GenPool behaviour (gen_pool v0.1.0)

Documentation for GenPool.

Link to this section Summary

Link to this section Types

@type new_state() :: term()

Link to this section Callbacks

Link to this callback

handle_call(request, pid, state)

(optional)
@callback handle_call(request :: term(), pid(), state :: term()) ::
  {:reply, reply, new_state}
  | {:reply, reply, new_state,
     timeout() | :hibernate | {:continue, continue_arg :: term()}}
  | {:noreply, new_state}
  | {:noreply, new_state,
     timeout() | :hibernate | {:continue, continue_arg :: term()}}
  | {:stop, reason, reply, new_state}
  | {:stop, reason, new_state}
when reply: term(), new_state: term(), reason: term()
Link to this callback

handle_cast(request, state)

(optional)
@callback handle_cast(request :: term(), state :: term()) ::
  {:noreply, new_state()}
  | {:noreply, new_state(),
     timeout() | :hibernate | {:continue, continue_arg :: term()}}
  | {:stop, reason :: term(), new_state()}
Link to this callback

handle_continue(continue_arg, state)

(optional)
@callback handle_continue(continue_arg, state :: term()) ::
  {:noreply, new_state}
  | {:noreply, new_state, timeout() | :hibernate | {:continue, continue_arg}}
  | {:stop, reason :: term(), new_state}
when new_state: term(), continue_arg: term()
Link to this callback

handle_info(msg, state)

(optional)
@callback handle_info(msg :: :timeout | term(), state :: term()) ::
  {:noreply, new_state}
  | {:noreply, new_state,
     timeout() | :hibernate | {:continue, continue_arg :: term()}}
  | {:stop, reason :: term(), new_state}
when new_state: term()
@callback init(init_arg :: term()) ::
  {:ok, state}
  | {:ok, state, timeout() | :hibernate | {:continue, continue_arg :: term()}}
  | :ignore
  | {:stop, reason :: any()}
when state: any()
Link to this callback

terminate(reason, state)

(optional)
@callback terminate(reason, state :: term()) :: term()
when reason: :normal | :shutdown | {:shutdown, term()} | term()

Link to this section Functions

Link to this function

call(gen_pool, params)

Link to this function

cast(gen_pool, params)

Link to this function

get_children(gen_pool)

Link to this function

get_state(gen_pool)

Link to this function

start_link(gen_pool, init_opts \\ [], process_opts \\ [])

Link to this function

stop(gen_pool, reason \\ :shutdown)