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
// Requires: live transport destination (webhook/NATS/etc).
use fraiseql_core::runtime::subscription::{
TransportManager, WebhookAdapter, WebhookTransportConfig, SubscriptionEvent,
};
let mut manager = TransportManager::new();
// Add webhook adapter
let webhook = WebhookAdapter::new(WebhookTransportConfig::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: BoxDynTransportAdapter)
pub fn add_adapter(&mut self, adapter: BoxDynTransportAdapter)
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. Delivery failures are accumulated
in DeliveryResult::errors rather than propagated as Err.
§Errors
Currently infallible — always returns Ok. Individual adapter failures are
captured in DeliveryResult::errors and do not short-circuit the method.
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more