Poolder.Behaviour behaviour (Poolder v0.1.3)

View Source

Summary

Callbacks

handle_error(data, attempt, error, state)

@callback handle_error(
  data :: any(),
  attempt :: integer(),
  error :: any(),
  state :: any()
) ::
  {:retry, state :: any()} | {:delay, integer()} | :halt

handle_init(id)

@callback handle_init(id :: integer()) :: {:ok, state :: any()}

handle_job(data, state)

@callback handle_job(data :: any(), state :: any()) ::
  {:noreply, state :: any()}
  | {:push, any(), any(), state :: any()}
  | {:reply, reply :: any(), state :: any()}
  | {:stop, reason :: any(), state :: any()}
  | {:exit, reason :: any(), state :: any()}

handle_periodic_job(name)

@callback handle_periodic_job(name :: atom()) ::
  :ok
  | :stop
  | :exit
  | {:set, integer()}
  | {:set, atom(), integer()}
  | {:kill, atom()}

handle_pool_ready(supervisor_pid)

@callback handle_pool_ready(supervisor_pid :: pid()) :: any()