pub struct WebhookSubscriber { /* private fields */ }Expand description
Subscriber that POSTs the event as JSON to a webhook URL.
Retries failed deliveries with exponential backoff (up to 3 attempts, 5 s timeout per attempt). The HTTP client is created once and reused.
Event type filtering is handled by the
EventPublisher at subscription time – this
subscriber receives only events that already passed the filter.
§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],
);Implementations§
Source§impl WebhookSubscriber
impl WebhookSubscriber
Sourcepub fn new(url: &str) -> Self
pub fn new(url: &str) -> Self
Create a new webhook subscriber targeting the given URL.
§Panics
Panics if the HTTP client cannot be built (TLS backend unavailable).
§Examples
use ironflow_engine::notify::WebhookSubscriber;
let subscriber = WebhookSubscriber::new("https://example.com/hook");
assert_eq!(subscriber.url(), "https://example.com/hook");Trait Implementations§
Source§impl EventSubscriber for WebhookSubscriber
impl EventSubscriber for WebhookSubscriber
Auto Trait Implementations§
impl Freeze for WebhookSubscriber
impl !RefUnwindSafe for WebhookSubscriber
impl Send for WebhookSubscriber
impl Sync for WebhookSubscriber
impl Unpin for WebhookSubscriber
impl UnsafeUnpin for WebhookSubscriber
impl !UnwindSafe for WebhookSubscriber
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more