pub struct Pool { /* private fields */ }Expand description
Runs operations in workers started ahead of demand. Clones share one pool.
The pool’s waiting workers are killed when its last clone, and the last writer made from it, is dropped.
Implementations§
Source§impl Pool
impl Pool
Sourcepub fn new(command: WorkerCommand, options: PoolOptions) -> Result<Pool, Error>
pub fn new(command: WorkerCommand, options: PoolOptions) -> Result<Pool, Error>
A pool of command workers. The caller is inside a Tokio runtime, which runs the task that starts them.
Sourcepub fn with_observer(
command: WorkerCommand,
options: PoolOptions,
observer: Arc<dyn Observer>,
) -> Result<Pool, Error>
pub fn with_observer( command: WorkerCommand, options: PoolOptions, observer: Arc<dyn Observer>, ) -> Result<Pool, Error>
A pool whose writers report each operation to observer as it ends.
Sourcepub fn writer(&self, tenant: &Tenant, key: impl Into<TenantKey>) -> OpWriter
pub fn writer(&self, tenant: &Tenant, key: impl Into<TenantKey>) -> OpWriter
A writer for one tenant whose operations run in this pool’s workers. key holds the write grant on
the tenant’s directory.
pub fn options(&self) -> &PoolOptions
pub fn stats(&self) -> PoolStats
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Pool
impl !UnwindSafe for Pool
impl Forget for Pool
impl Freeze for Pool
impl Move for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnsafeUnpin for Pool
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request