Ant.Worker behaviour (Ant v0.0.2)

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Types

@type t() :: %Ant.Worker{
  args: map(),
  attempts: non_neg_integer(),
  errors: [map()],
  id: non_neg_integer(),
  opts: keyword(),
  queue_name: String.t(),
  scheduled_at: DateTime.t(),
  status:
    :enqueued
    | :running
    | :scheduled
    | :completed
    | :failed
    | :retrying
    | :cancelled,
  updated_at: DateTime.t(),
  worker_module: module()
}

Callbacks

Link to this callback

calculate_delay(worker)

(optional)
@callback calculate_delay(worker :: t()) :: non_neg_integer()
Link to this callback

perform(worker)

@callback perform(worker :: t()) :: :ok | {:ok, any()} | {:error, any()}

Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Callback implementation for GenServer.init/1.

Link to this function

perform(worker_pid)

Link to this function

start_link(worker)