Jido.Agent.Directive.Spawn (Jido v2.0.0-rc.1)

View Source

Spawn a generic BEAM child process under the agent's supervisor.

This is a low-level, fire-and-forget directive for spawning non-agent processes (Tasks, GenServers, etc.). The spawned process is not tracked in the agent's children map and has no parent-child relationship semantics.

Use SpawnAgent instead if you need to spawn another Jido agent with:

  • Parent-child hierarchy tracking
  • Process monitoring and exit signals
  • The ability to use emit_to_parent/3 from the child
  • Lifecycle management via StopChild

Fields

  • child_spec - Supervisor child_spec for the process to spawn
  • tag - Optional correlation tag for logging (not used for tracking)

Summary

Functions

Returns the Zoi schema for Spawn.

Types

t()

@type t() :: %Jido.Agent.Directive.Spawn{child_spec: any(), tag: any()}

Functions

schema()

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

Returns the Zoi schema for Spawn.