pub struct TenantConnectionPool { /* private fields */ }Expand description
Tenant connection pool manager
Manages connection pools across all tenants.
Implementations§
Source§impl TenantConnectionPool
impl TenantConnectionPool
Sourcepub fn new(default_config: TenantPoolConfig) -> Self
pub fn new(default_config: TenantPoolConfig) -> Self
Create a new tenant connection pool manager
Sourcepub fn with_dedicated_threshold(self, threshold: u32) -> Self
pub fn with_dedicated_threshold(self, threshold: u32) -> Self
Set dedicated pool threshold
Sourcepub fn get_pool(
&self,
tenant: &TenantId,
config: &TenantConfig,
) -> Arc<TenantPool> ⓘ
pub fn get_pool( &self, tenant: &TenantId, config: &TenantConfig, ) -> Arc<TenantPool> ⓘ
Get or create pool for tenant
Sourcepub fn get_existing_pool(&self, tenant: &TenantId) -> Option<Arc<TenantPool>>
pub fn get_existing_pool(&self, tenant: &TenantId) -> Option<Arc<TenantPool>>
Get existing pool for tenant (if any)
Sourcepub fn create_tenant_pool(&self, tenant: &TenantId, config: TenantPoolConfig)
pub fn create_tenant_pool(&self, tenant: &TenantId, config: TenantPoolConfig)
Create a tenant-specific pool
Sourcepub fn remove_tenant_pool(&self, tenant: &TenantId) -> Option<Arc<TenantPool>>
pub fn remove_tenant_pool(&self, tenant: &TenantId) -> Option<Arc<TenantPool>>
Remove a tenant pool
Sourcepub fn next_connection_id(&self) -> u64
pub fn next_connection_id(&self) -> u64
Generate new connection ID
Sourcepub fn record_acquire(&self)
pub fn record_acquire(&self)
Record an acquire attempt
Sourcepub fn record_timeout(&self)
pub fn record_timeout(&self)
Record a timeout
Sourcepub fn all_stats(&self) -> Vec<TenantPoolStats>
pub fn all_stats(&self) -> Vec<TenantPoolStats>
Get all tenant pool stats
Sourcepub fn tenant_stats(&self, tenant: &TenantId) -> Option<TenantPoolStats>
pub fn tenant_stats(&self, tenant: &TenantId) -> Option<TenantPoolStats>
Get tenant pool stats
Get shared pool stats
Sourcepub fn tenant_pool_count(&self) -> usize
pub fn tenant_pool_count(&self) -> usize
Get total number of tenant pools
Sourcepub fn aggregate_stats(&self) -> AggregatePoolStats
pub fn aggregate_stats(&self) -> AggregatePoolStats
Get aggregate statistics
Auto Trait Implementations§
impl !Freeze for TenantConnectionPool
impl !RefUnwindSafe for TenantConnectionPool
impl Send for TenantConnectionPool
impl Sync for TenantConnectionPool
impl Unpin for TenantConnectionPool
impl UnsafeUnpin for TenantConnectionPool
impl UnwindSafe for TenantConnectionPool
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more