automata/event/source

Types

Identification of the producer that emitted an event.

id is the stable identifier of the producer (e.g. plan id, watch path, webhook endpoint). name is an optional human-readable label.

pub type Source {
  Source(
    kind: SourceKind,
    id: String,
    name: option.Option(String),
  )
}

Constructors

Classification of where an event originated.

Closed sum for known transports plus CustomSource(String) as the escape hatch for ecosystem-external sources (e.g. internal protocols or experimental integrations).

pub type SourceKind {
  ScheduleSource
  FileSystemSource
  ManualSource
  WebhookSource
  QueueSource
  SignalSource
  HttpSource
  CloudEventSource
  CustomSource(String)
}

Constructors

  • ScheduleSource
  • FileSystemSource
  • ManualSource
  • WebhookSource
  • QueueSource
  • SignalSource
  • HttpSource
  • CloudEventSource
  • CustomSource(String)

Values

pub fn cloud_event(id id: String) -> Source

Shortcut for new(CloudEventSource, id).

pub fn custom(kind kind: String, id id: String) -> Source

Shortcut for new(CustomSource(kind), id) — the escape hatch for ecosystem-external producers.

pub fn file_system(id id: String) -> Source

Shortcut for new(FileSystemSource, id).

pub fn http(id id: String) -> Source

Shortcut for new(HttpSource, id).

pub fn kind_to_string(kind: SourceKind) -> String

Stable string label for a SourceKind, used for routing tables, metrics, and structured logs.

pub fn manual(id id: String) -> Source

Shortcut for new(ManualSource, id).

pub fn new(kind kind: SourceKind, id id: String) -> Source

Build a Source with no human-readable label. Use with_name to attach one if your transport/observability needs it.

pub fn queue(id id: String) -> Source

Shortcut for new(QueueSource, id).

pub fn schedule(id id: String) -> Source

Shortcut for new(ScheduleSource, id).

pub fn signal(id id: String) -> Source

Shortcut for new(SignalSource, id).

pub fn webhook(id id: String) -> Source

Shortcut for new(WebhookSource, id).

pub fn with_name(
  source source: Source,
  name name: String,
) -> Source

Attach an optional human-readable label to a source.

Search Document