pub struct EventStream { /* private fields */ }Expand description
Receives Events from one app-server connection.
Own exactly one EventStream per connection and keep draining it (even if
you only care about requests, not notifications). The channel between the
reader task and this stream is bounded (see
DEFAULT_EVENTS_CHANNEL_CAPACITY, overridable per-connection via
CodexAppServerClient::spawn_with_events_capacity and friends): a slow
consumer just grows a fixed-size backlog, but a consumer that stops
draining entirely will eventually cause the reader task to drop events
once that backlog fills. Drop policy when full:
Event::Notification: dropped and logged - fire-and-forget by design.Event::Request: not silently dropped - this crate sends a fallback error reply on the app-server’s behalf first (so it isn’t left hanging), then drops the event.Event::Closed: dropped and logged, but harmless - once the reader task ends it drops its sender, soSelf::recvstill observes the connection closing (asNone) even without the explicit event.
Implementations§
Auto Trait Implementations§
impl Freeze for EventStream
impl RefUnwindSafe for EventStream
impl Send for EventStream
impl Sync for EventStream
impl Unpin for EventStream
impl UnsafeUnpin for EventStream
impl UnwindSafe for EventStream
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