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:
WebhookSubscriber– POSTs JSON to a URL with retry and exponential backoff.BetterStackSubscriber– forwards error events to BetterStack Logs.
§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 viatokio::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§
- Better
Stack Subscriber - Subscriber that forwards error events to BetterStack Logs.
- Event
Publisher - Broadcasts
Events to registeredEventSubscribers. - Webhook
Subscriber - Subscriber that POSTs the event as JSON to a webhook URL.
Enums§
- Event
- A domain event emitted by the ironflow system.
Traits§
- Event
Subscriber - A subscriber that reacts to domain events.
Type Aliases§
- Subscriber
Future - Boxed future returned by
EventSubscriber::handle.