Oi.Configurator (oi v0.1.0)

Copy Markdown

Immutable dispatch configuration.

Built once at the dispatch boundary, threaded to Worker and the plugin chain. Controls executor selection, concurrency, timeout, and Orchid plugin pipeline.

Options

  • :executor — module implementing Oi.Executor (default: Oi.Executor.Sync)
  • :executor_opts — keyword opts passed to executor's run/3
  • :plugins — ordered list of {plugin, context} tuples
  • :orchid_baggage — map merged into every Orchid run's baggage
  • :orchid_opts — extra keyword opts forwarded to Orchid.run/3
  • :concurrency — fallback for executor if :executor_opts has none
  • :timeout — fallback for executor if :executor_opts has none

Summary

Functions

Run every plugin in order over the {recipe, run_opts} tuple. Each plugin may rewrite the recipe or append to run_opts.

Types

t()

@type t() :: %Oi.Configurator{
  concurrency: pos_integer(),
  executor: module(),
  executor_opts: keyword(),
  orchid_baggage: map(),
  orchid_opts: keyword(),
  plugins: [{module(), context :: any()}],
  timeout: timeout()
}

Functions

apply_plugins(configurator, orchid_tuple)

@spec apply_plugins(
  t(),
  {Orchid.Recipe.t(), keyword()}
) :: {Orchid.Recipe.t(), keyword()}

Run every plugin in order over the {recipe, run_opts} tuple. Each plugin may rewrite the recipe or append to run_opts.

new(opts \\ [])

@spec new(keyword()) :: t()