pub struct WebhookAdapter { /* private fields */ }Expand description
Webhook transport adapter for HTTP POST delivery.
Delivers subscription events via HTTP POST with:
- HMAC-SHA256 signature (X-FraiseQL-Signature header)
- Exponential backoff retry logic
- Configurable timeouts
§Example
ⓘ
use fraiseql_core::runtime::subscription::{WebhookAdapter, WebhookConfig};
let config = WebhookConfig::new("https://api.example.com/webhooks")
.with_secret("my_secret_key")
.with_max_retries(3);
let adapter = WebhookAdapter::new(config);
adapter.deliver(&event, "orderCreated").await?;Implementations§
Source§impl WebhookAdapter
impl WebhookAdapter
Sourcepub fn new(config: WebhookConfig) -> Self
pub fn new(config: WebhookConfig) -> Self
Create a new webhook adapter.
§Panics
Panics if the HTTP client cannot be built (should not happen in practice).
Trait Implementations§
Source§impl Debug for WebhookAdapter
impl Debug for WebhookAdapter
Source§impl TransportAdapter for WebhookAdapter
impl TransportAdapter for WebhookAdapter
Source§fn deliver<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
event: &'life1 SubscriptionEvent,
subscription_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), SubscriptionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn deliver<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
event: &'life1 SubscriptionEvent,
subscription_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), SubscriptionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Deliver an event to the transport. Read more
Auto Trait Implementations§
impl Freeze for WebhookAdapter
impl !RefUnwindSafe for WebhookAdapter
impl Send for WebhookAdapter
impl Sync for WebhookAdapter
impl Unpin for WebhookAdapter
impl UnsafeUnpin for WebhookAdapter
impl !UnwindSafe for WebhookAdapter
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