Orchid.Executor behaviour (Orchid v0.6.1)

Copy Markdown View Source

Executor behavoir.

An executor receive a Orchid.Scheduler.Context struct and do execution.

There're some functions recommend to use during execution.

Summary

Functions

Executes the next ready step in the given context.

Types

executor()

@type executor() :: module()

executor_opts()

@type executor_opts() :: keyword()

response()

@type response() ::
  {:ok, Orchid.Scheduler.Context.param_map()} | {:error, Orchid.Error.t()}

Callbacks

execute(t, executor_opts)

@callback execute(Orchid.Scheduler.Context.t(), executor_opts()) :: response()

Functions

execute_next_step(ctx)

@spec execute_next_step(Orchid.Scheduler.Context.t()) ::
  {:done, Orchid.Scheduler.Context.t()}
  | {:stuck, Orchid.Scheduler.Context.t()}
  | {:cont, Orchid.Scheduler.Context.t()}
  | {:error, Orchid.Error.t()}

Executes the next ready step in the given context.

Debugging helper function for executors.