mule/config

Types

pub type Config {
  Config(
    name: String,
    node: String,
    engine: engine.Engine,
    notifier: notifier.Notifier,
    peer: peer.Peer,
    registry: worker_registry.Registry,
    queues: List(#(String, Int)),
    stage_interval: duration.Duration,
    producer_poll_interval: duration.Duration,
    dispatch_cooldown: duration.Duration,
    shutdown_grace_period: duration.Duration,
    testing: Testing,
  )
}

Constructors

config.ex testing:. Inline carries the pre-built inline engine record because get_engine cannot construct it here (engines/inline sits above config in the import graph) — mule.start and testing.with_testing_mode build and instrument it. User specs carry mule.TestingMode instead.

pub type Testing {
  Disabled
  Manual
  Inline(engine: engine.Engine)
}

Constructors

Values

pub fn get_engine(config config: Config) -> engine.Engine

config.ex get_engine/1, minus the process-dictionary override (Gleam has no ambient state — see testing.with_testing_mode for the substitute): config.engine unless testing is Inline. Consumers that can run under a testing mode (the mule.gleam public API, the drainer) must call this; runtime components (producer/stager/plugins) keep reading config.engine directly because testing modes never start them — unobservably equivalent to Elixir routing them through the Engine facade.

pub fn ident(name name: String, node node: String) -> String

The ident format itself, for building a foreign node’s ident (the OnNode signal scope) — single-sourced here so publishers and the to_ident consumers can never disagree on the shape.

pub fn to_ident(config: Config) -> String

config.ex to_ident: name <> "." <> node — the key inbound signal scoping compares an incoming ident against.

Search Document