Expand description
Asynchronous webhook notification system with bounded queue.
Responsibilities:
- Enqueue webhook events to a background worker (non-blocking).
- Background worker handles HTTP delivery with retries.
- Bounded queue with configurable backpressure policy.
- Generate HMAC-SHA256 signatures for webhook verification.
- Expose delivery diagnostics and bounded replay controls for failed events.
Does NOT handle:
- Webhook endpoint management or registration.
- UI mode detection (callers should suppress if desired).
- Response processing beyond HTTP status check.
- Exactly-once delivery guarantees.
Invariants:
- Webhook failures are logged but never fail the calling operation.
- Secrets are never logged or exposed in error messages.
- All requests include a timeout to prevent hanging.
- Queue backpressure protects interactive UX from slow endpoints.
- Worker thread is automatically cleaned up on drop.
Re-exports§
pub use crate::contracts::WebhookQueuePolicy;
Structs§
- Replay
Candidate - Replay
Report - Replay
Selector - Resolved
Webhook Config - Resolved webhook configuration with defaults applied.
- Webhook
Context - Optional context metadata for webhook payloads. These fields are only serialized when set (Some).
- Webhook
Diagnostics - Webhook
Failure Record - Webhook
Payload - Webhook event payload structure.
Enums§
- Webhook
Event Type - Types of webhook events that can be sent.
Functions§
- diagnostics_
snapshot - failure_
store_ path - init_
worker_ for_ parallel - Initialize the global webhook worker with capacity scaled for parallel execution. Call this instead of relying on implicit init when running in parallel mode.
- notify_
loop_ started - Convenience function to send loop started webhook. This is a loop-level event with no task association.
- notify_
loop_ stopped - Convenience function to send loop stopped webhook. This is a loop-level event with no task association.
- notify_
phase_ completed - Convenience function to send phase completed webhook.
- notify_
phase_ started - Convenience function to send phase started webhook.
- notify_
queue_ unblocked - Convenience function to send queue unblocked webhook. This is a loop-level event with no task association.
- notify_
status_ changed - Convenience function to send generic status change webhook.
- notify_
task_ completed - Convenience function to send task completed webhook.
- notify_
task_ completed_ with_ context - Convenience function to send task completed webhook with context.
- notify_
task_ created - Convenience function to send task creation webhook.
- notify_
task_ created_ with_ context - Convenience function to send task creation webhook with context.
- notify_
task_ failed - Convenience function to send task failed/rejected webhook.
- notify_
task_ failed_ with_ context - Convenience function to send task failed webhook with context.
- notify_
task_ started - Convenience function to send task started webhook.
- notify_
task_ started_ with_ context - Convenience function to send task started webhook with context.
- replay_
failed_ deliveries - send_
webhook - Send a webhook notification (non-blocking, enqueues for delivery).
- send_
webhook_ payload - Send a webhook payload directly (non-blocking, enqueues for delivery).