pub struct ManagedClientSession { /* private fields */ }Expand description
Running managed client session.
ManagedClientSession::join waits for the worker and returns the session
outcome or client error. Dropping the session requests cooperative
cancellation; callers that need the outcome should explicitly join instead
of relying on drop.
Implementations§
Source§impl ManagedClientSession
impl ManagedClientSession
Sourcepub fn subscribe(
&self,
config: SubscriberConfig,
) -> Result<EventSubscription, ClientError>
pub fn subscribe( &self, config: SubscriberConfig, ) -> Result<EventSubscription, ClientError>
Add another event subscriber to this running managed session.
The subscription receives only events published after it is registered.
Sourcepub fn stop(&self)
pub fn stop(&self)
Request cooperative cancellation of the managed session.
Cancellation is observed by the worker loop between socket receive,
timeout polling, and send scheduling steps. Call join to
wait for the worker and obtain the final SessionOutcome.
Sourcepub fn join(self) -> Result<SessionOutcome, ClientError>
pub fn join(self) -> Result<SessionOutcome, ClientError>
Wait for the managed worker thread to finish.
On success, returns lifecycle counters for the completed session. If the
worker panicked, this returns ClientError::WorkerPanicked. Joining
also disconnects all event subscriptions while leaving already queued
events available to drain.