pub struct RuntimeSubscriptionHub { /* private fields */ }Expand description
Combines replay and live fanout for runtime event streams.
subscribe_run reads a replay page from the store and opens a live
subscription to the run room in one call. The caller owns the ordering
decision (replay first, then live).
Implementations§
Source§impl RuntimeSubscriptionHub
impl RuntimeSubscriptionHub
Sourcepub fn new(
event_store: Arc<dyn RuntimeEventStore>,
stream_adapter: Arc<dyn RuntimeStreamAdapter>,
) -> Self
pub fn new( event_store: Arc<dyn RuntimeEventStore>, stream_adapter: Arc<dyn RuntimeStreamAdapter>, ) -> Self
Creates a hub over the given store and adapter.
Sourcepub async fn subscribe_run(
&self,
run_id: RunId,
after_seq: Option<u64>,
limit: usize,
) -> Result<RuntimeSubscription, RuntimeSubscriptionError>
pub async fn subscribe_run( &self, run_id: RunId, after_seq: Option<u64>, limit: usize, ) -> Result<RuntimeSubscription, RuntimeSubscriptionError>
Returns replay events plus a live stream for run_id.
The live subscription is opened first so no event published between
replay and subscription is lost; the caller deduplicates overlapping
events via RuntimeEventEnvelope::seq.
§Errors
Returns RuntimeSubscriptionError::Live when the stream adapter
refuses the live subscription, and
RuntimeSubscriptionError::Replay when the event store cannot
fulfil the replay request.
Auto Trait Implementations§
impl !RefUnwindSafe for RuntimeSubscriptionHub
impl !UnwindSafe for RuntimeSubscriptionHub
impl Freeze for RuntimeSubscriptionHub
impl Send for RuntimeSubscriptionHub
impl Sync for RuntimeSubscriptionHub
impl Unpin for RuntimeSubscriptionHub
impl UnsafeUnpin for RuntimeSubscriptionHub
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