Jido.Agent.Directive.Emit (Jido v2.0.0-rc.0)

View Source

Dispatch a signal via Jido.Signal.Dispatch.

The runtime interprets this directive by calling:

Jido.Signal.Dispatch.dispatch(signal, dispatch_config)

Fields

  • signal - A Jido.Signal.t() struct to dispatch
  • dispatch - Dispatch config: {adapter, opts} or list of configs
    • :pid - Direct to process
    • :pubsub - Via PubSub
    • :bus - To signal bus
    • :http / :webhook - HTTP endpoints
    • :logger / :console / :noop - Logging/testing

Examples

# Use agent's default dispatch (configured on AgentServer)
%Emit{signal: signal}

# Explicit dispatch to PubSub
%Emit{signal: signal, dispatch: {:pubsub, topic: "events"}}

# Multiple dispatch targets
%Emit{signal: signal, dispatch: [
  {:pubsub, topic: "events"},
  {:logger, level: :info}
]}

Summary

Functions

Returns the Zoi schema for Emit.

Types

t()

@type t() :: %Jido.Agent.Directive.Emit{dispatch: any(), signal: any()}

Functions

schema()

@spec schema() :: Zoi.schema()

Returns the Zoi schema for Emit.