mule/plugin

Types

A runtime plugin: anything that supervises a periodic actor alongside the Stager and producers — Cron now, Pruner and Lifeline later. Given the assembled Config, it yields the child spec that starts it. Child data is erased to Nil, like the adapter child specs, since the supervisor never needs the started subject.

This is the Gleam analog of an entry in Oban’s plugins: [...] list: mule depends only on this neutral type, never on a concrete plugin module. Build one with a plugin’s own constructor, e.g. cron.plugin(crontab).

pub type Plugin {
  Plugin(
    child_spec: fn(config.Config) -> supervision.ChildSpecification(
      Nil,
    ),
  )
}

Constructors

Search Document