pub struct TransportManager { /* private fields */ }Expand description
Multi-transport delivery manager.
Manages multiple transport adapters and delivers events to all configured destinations in parallel.
§Example
ⓘ
use fraiseql_core::runtime::subscription::{
TransportManager, WebhookAdapter, WebhookConfig,
};
let mut manager = TransportManager::new();
// Add webhook adapter
let webhook = WebhookAdapter::new(WebhookConfig::new("https://api.example.com/events"));
manager.add_adapter(Box::new(webhook));
// Deliver to all transports
manager.deliver_all(&event, "orderCreated").await?;Implementations§
Source§impl TransportManager
impl TransportManager
Sourcepub fn add_adapter(&mut self, adapter: Box<dyn TransportAdapter>)
pub fn add_adapter(&mut self, adapter: Box<dyn TransportAdapter>)
Add a transport adapter.
Sourcepub fn adapter_count(&self) -> usize
pub fn adapter_count(&self) -> usize
Get the number of configured adapters.
Sourcepub async fn deliver_all(
&self,
event: &SubscriptionEvent,
subscription_name: &str,
) -> Result<DeliveryResult, SubscriptionError>
pub async fn deliver_all( &self, event: &SubscriptionEvent, subscription_name: &str, ) -> Result<DeliveryResult, SubscriptionError>
Deliver an event to all configured transports.
Delivers in parallel and collects results. Returns Ok if at least one delivery succeeded, or the last error if all failed.
Sourcepub async fn health_check_all(&self) -> Vec<(String, bool)>
pub async fn health_check_all(&self) -> Vec<(String, bool)>
Check health of all adapters.
Trait Implementations§
Source§impl Debug for TransportManager
impl Debug for TransportManager
Auto Trait Implementations§
impl Freeze for TransportManager
impl !RefUnwindSafe for TransportManager
impl Send for TransportManager
impl Sync for TransportManager
impl Unpin for TransportManager
impl UnsafeUnpin for TransportManager
impl !UnwindSafe for TransportManager
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