pub struct PoolRegistry { /* private fields */ }Expand description
The account-agnostic registry of session pools, keyed by (account, user).
Cheap to clone (everything is behind Arc). The map mutex is std (never held
across .await); the shared auth gate serializes browser auths across pools.
Implementations§
Source§impl PoolRegistry
impl PoolRegistry
Sourcepub fn get_or_create(&self, key: &SessionKey, max: usize) -> Arc<SessionPool>
pub fn get_or_create(&self, key: &SessionKey, max: usize) -> Arc<SessionPool>
Returns the pool for key, creating an empty one (no auth) if absent.
New pools share the registry’s auth gate, so all browser auths across all
pools are serialized to one at a time.
Sourcepub fn get(&self, key: &SessionKey) -> Option<Arc<SessionPool>>
pub fn get(&self, key: &SessionKey) -> Option<Arc<SessionPool>>
Returns the pool for key without creating one (unlike
get_or_create). Used by read-only paths like
cancel that must not spin up an empty pool.
Sourcepub fn get_by_id(&self, id: u64) -> Option<Arc<SessionPool>>
pub fn get_by_id(&self, id: u64) -> Option<Arc<SessionPool>>
Returns the pool with the given id, if present, without creating one.
Sourcepub fn remove(&self, key: &SessionKey) -> Option<Arc<SessionPool>>
pub fn remove(&self, key: &SessionKey) -> Option<Arc<SessionPool>>
Removes the pool for key. Returns it if present.
Sourcepub fn remove_by_id(&self, id: u64) -> Option<Arc<SessionPool>>
pub fn remove_by_id(&self, id: u64) -> Option<Arc<SessionPool>>
Removes the pool with the given id. Returns it if present.
Sourcepub fn take_all(&self) -> Vec<Arc<SessionPool>>
pub fn take_all(&self) -> Vec<Arc<SessionPool>>
Drains and returns every pool.
Sourcepub fn pools(&self) -> Vec<Arc<SessionPool>>
pub fn pools(&self) -> Vec<Arc<SessionPool>>
Live handles to every pool, ordered by id, without draining the registry. Used by the keep-alive heartbeat to visit each pool.
Sourcepub fn snapshot(&self) -> Vec<SessionInfo>
pub fn snapshot(&self) -> Vec<SessionInfo>
A snapshot of every pool, ordered by id. Sync; no awaits.
Trait Implementations§
Source§impl Clone for PoolRegistry
impl Clone for PoolRegistry
Source§fn clone(&self) -> PoolRegistry
fn clone(&self) -> PoolRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more