Oi. Dispatch. Config
(oi v0.6.3)
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 implementingOi.Executor(default:Oi.Executor.Sync):executor_opts— keyword opts passed to executor'srun/3:orchid_adapters— ordered list offn {recipe, opts}, conf -> {recipe, opts}adapters:orchid_baggage— map merged into every Orchid run's baggage:orchid_opts— extra keyword opts forwarded toOrchid.run/3:concurrency— fallback for executor if:executor_optshas none:timeout— fallback for executor if:executor_optshas 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.
Assemble keyword opts for Orchid.run/3.
Delegates to Options.assemble_run_opts/3.
Build a Drafting from user :data and compiled graph topology.
Delegates to Options.build_drafting_inputs/2.
Types
@type data() :: map()
Unified user-facing data for Oi.execute/2.
Two formats supported:
- Tuple keys:
%{{:step1, :in} => "foo", {:step2, :out} => {:override, "bar"}} - Nested:
%{step1: %{in: "foo"}, step2: %{out: {:override, "bar"}}}
@type t() :: %Oi.Dispatch.Config{ concurrency: pos_integer(), data: map(), executor: module(), executor_opts: keyword(), name: Oi.name() | nil, orchid_adapters: [ ({Orchid.Recipe.t(), keyword()}, t() -> {Orchid.Recipe.t(), keyword()}) | ({Orchid.Recipe.t(), keyword()} -> {Orchid.Recipe.t(), keyword()}) ], orchid_baggage: map(), orchid_opts: keyword(), timeout: timeout() }
Functions
@spec apply_orchid_adapters( 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.
@spec assemble_run_opts(t(), Oi.Dispatch.Drafting.t()) :: keyword()
Assemble keyword opts for Orchid.run/3.
Delegates to Options.assemble_run_opts/3.
@spec build_drafting(t(), Oi.Compiled.t()) :: {:ok, Oi.Dispatch.Drafting.t()} | {:error, term()}
Build a Drafting from user :data and compiled graph topology.
Delegates to Options.build_drafting_inputs/2.