Jidoka.Runtime.LocalOperations (Jidoka v0.9.0)

Copy Markdown View Source

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

handler()

Functions

operations(handlers)

@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
  })