Skip to main content

Module notify

Module notify 

Source
Expand description

Event-driven notification system for the ironflow lifecycle.

Uses a publisher/subscriber pattern: the EventPublisher broadcasts Events to registered EventSubscribers. Event type filtering is handled by the publisher at subscription time – subscribers only receive events they signed up for.

Built-in subscribers:

§Architecture

  • Event – domain event enum covering runs, steps, approvals, auth.
  • EventSubscriber – trait: receives and handles a single event.
  • EventPublisher – holds subscriptions (subscriber + event type filter), dispatches matching events via tokio::spawn.
  • WebhookSubscriber – built-in HTTP POST implementation.

§Examples

use ironflow_engine::notify::{Event, EventPublisher, WebhookSubscriber};

let mut publisher = EventPublisher::new();
publisher.subscribe(
    WebhookSubscriber::new("https://hooks.example.com/events"),
    &[Event::RUN_STATUS_CHANGED, Event::STEP_FAILED],
);

Structs§

BetterStackSubscriber
Subscriber that forwards error events to BetterStack Logs.
EventPublisher
Broadcasts Events to registered EventSubscribers.
WebhookSubscriber
Subscriber that POSTs the event as JSON to a webhook URL.

Enums§

Event
A domain event emitted by the ironflow system.

Traits§

EventSubscriber
A subscriber that reacts to domain events.

Type Aliases§

SubscriberFuture
Boxed future returned by EventSubscriber::handle.