Synapse.Runtime (Synapse v0.1.1)

View Source

Supervises the core Synapse runtime components (Signal Router, Agent Registry, Specialist Supervisor) and exposes a handle that other modules can use to obtain the correct router/bus/registry names without relying on globals.

Summary

Functions

Returns a specification to start this module under a supervisor.

Fetches the runtime handle for the given name (defaults to the application runtime).

Starts a runtime supervisor.

Types

t()

@type t() :: %Synapse.Runtime{
  bus: atom(),
  name: atom(),
  registry: atom(),
  router: atom(),
  specialist_supervisor: atom()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

fetch(name \\ Synapse.Runtime)

@spec fetch(atom()) :: t()

Fetches the runtime handle for the given name (defaults to the application runtime).

start_link(opts \\ [])

@spec start_link(keyword()) :: Supervisor.on_start()

Starts a runtime supervisor.

Options:

  • :name - runtime identifier (defaults to Synapse.Runtime)
  • :router_name - override generated router process name
  • :bus_name - override generated bus process name
  • :registry_name - override agent registry name
  • :specialists_name - override specialist supervisor name
  • :router_opts - additional options for Synapse.SignalRouter.start_link/1
  • :bus_opts - additional options passed through to the router's bus