pub struct RuntimeEventBridge { /* private fields */ }Expand description
Drains AgentRuntime::subscribe
into the event store and stream adapter.
The bridge appends each event to the store first; only on a successful append does it publish the envelope to the run room (and, when a session id is known, to the session room). Append failure therefore never produces a live event with an incomplete replay source.
Implementations§
Source§impl RuntimeEventBridge
impl RuntimeEventBridge
Sourcepub fn new(
runtime: Arc<AgentRuntime>,
event_store: Arc<dyn RuntimeEventStore>,
stream_adapter: Arc<dyn RuntimeStreamAdapter>,
) -> Self
pub fn new( runtime: Arc<AgentRuntime>, event_store: Arc<dyn RuntimeEventStore>, stream_adapter: Arc<dyn RuntimeStreamAdapter>, ) -> Self
Creates a bridge wiring runtime to event_store and stream_adapter.
Sourcepub fn spawn(self: Arc<Self>) -> RuntimeEventBridgeHandle
pub fn spawn(self: Arc<Self>) -> RuntimeEventBridgeHandle
Spawns the background forwarding task and returns a handle.
The task runs until the runtime’s event broadcast closes or the handle is dropped/aborted.
Auto Trait Implementations§
impl !RefUnwindSafe for RuntimeEventBridge
impl !UnwindSafe for RuntimeEventBridge
impl Freeze for RuntimeEventBridge
impl Send for RuntimeEventBridge
impl Sync for RuntimeEventBridge
impl Unpin for RuntimeEventBridge
impl UnsafeUnpin for RuntimeEventBridge
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