Runtime support for executing local Elixir functions as Jidoka operations.
This is the current supported helper for deterministic tool tests, examples,
and simple in-process operations. Production tool authoring should normally
use Jidoka.Action, which is backed by Jido.Action.
Summary
Functions
Builds an operation function from a map of operation handlers.
Types
@type handler() :: (map(), Jidoka.Context.t() -> term()) | (Jidoka.Effect.Intent.t(), Jidoka.Effect.Journal.t(), Jidoka.Context.t() -> term())
Functions
@spec operations(%{required(String.t() | atom()) => handler()}) :: Jidoka.Operation.Capability.t()
Builds an operation function from a map of operation handlers.
operations =
Jidoka.Runtime.LocalOperations.operations(%{
"local_time" => fn %{"city" => city}, _ctx -> {:ok, %{city: city, time: "09:30"}} end
})