Poolder.Worker behaviour (Poolder v0.1.10)

View Source

Summary

Callbacks

handle_call(msg, from, state)

@callback handle_call(msg :: any(), from :: pid(), state :: any()) ::
  {:reply, response :: any(), state :: any()} | any()

handle_error(data, attempt, error, state)

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

handle_hibernate(state)

@callback handle_hibernate(state :: any()) :: any()

handle_init(args)

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

handle_job(data, state)

@callback handle_job(data :: any(), state :: any()) ::
  {:ok, state :: any()}
  | {fun_callback :: atom(), args :: any(), any(), state :: any()}
  | {:stop, reply :: any(), state :: any()}
  | {:stop, state :: any()}
  | any()

terminate(reason, state)

@callback terminate(reason :: any(), state :: any()) :: any()