Raxol.Core.Runtime.Directive.Executor protocol (Raxol Core v2.6.0)

Copy Markdown View Source

Protocol for executing runtime directives.

Built-in implementations cover Raxol.Core.Runtime.Directive.{Stop, Schedule, Spawn}. Packages register additional directive types by defining a struct and implementing this protocol for it. raxol_agent provides impls for Raxol.Agent.Directive.{Async, Shell, SendAgent}; raxol_payments and raxol_acp provide their own.

Context

The context map carries at minimum:

  • :pid - process to receive {:command_result, payload} messages
  • :runtime_pid - process to receive runtime-level signals (e.g. quit)

Effect messages land at context.pid as {:command_result, payload}. Consumers rely on the asynchronous result message rather than the return value of execute/2.

Summary

Types

t()

All the types that implement this protocol.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

execute(directive, context)

@spec execute(t(), context :: map()) :: any()