pub struct SessionRegistry<T, E = SessionError> { /* private fields */ }Expand description
The sessions an engine is serving, keyed by the id the SDK gave them.
Implementations§
Source§impl<T: Clone, E: Clone + From<SessionError>> SessionRegistry<T, E>
impl<T: Clone, E: Clone + From<SessionError>> SessionRegistry<T, E>
Sourcepub async fn resolve(&self, id: Uuid) -> Established<T, E>
pub async fn resolve(&self, id: Uuid) -> Established<T, E>
The payload a request runs against, waiting for the session to be registered if its lifecycle event has not been applied yet.
Sourcepub fn entry(&self, id: Uuid) -> Arc<SessionEntry<T, E>> ⓘ
pub fn entry(&self, id: Uuid) -> Arc<SessionEntry<T, E>> ⓘ
The entry a lifecycle event publishes into, creating it if a request is not already waiting on one.
Sourcepub fn established(&self, id: Uuid) -> Option<Established<T, E>>
pub fn established(&self, id: Uuid) -> Option<Established<T, E>>
How a session stands right now, without waiting for one or registering one.
This is what work that cannot wait resolves against — delivering a notification, say, which has nowhere to go if its session is gone.
Sourcepub fn end(&self, id: Uuid) -> Option<Established<T, E>>
pub fn end(&self, id: Uuid) -> Option<Established<T, E>>
Ends a session, failing anything waiting on it.
The failure is published before the session is forgotten, so a request that outlived the handle it was made from fails rather than waiting for a session that has just gone away.
Trait Implementations§
Auto Trait Implementations§
impl<T, E = SessionError> !Freeze for SessionRegistry<T, E>
impl<T, E> RefUnwindSafe for SessionRegistry<T, E>where
Mutex<Entries<T, E>>: RefUnwindSafe,
impl<T, E> Send for SessionRegistry<T, E>
impl<T, E> Sync for SessionRegistry<T, E>
impl<T, E> Unpin for SessionRegistry<T, E>
impl<T, E> UnsafeUnpin for SessionRegistry<T, E>where
Mutex<Entries<T, E>>: UnsafeUnpin,
impl<T, E> UnwindSafe for SessionRegistry<T, E>where
Mutex<Entries<T, E>>: UnwindSafe,
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