pub struct Pool { /* private fields */ }
Expand description

A Pool orchestrates two different threadpools, a compressor pool and a writer pool.

The pool is suitable for scenarios where there are many more writers than threads, efficiently managing resources for M writers to N threads.

Implementations

Create a running pool along with an associated set of pooled_writers.

Arguments
  • num_writer_threads - The number of writer threads to use in the writer pool.
  • num_compressor_threads - The number of compressor threads to use in the compressor pool.
  • compression_level - The compression level to use for the Compressor pool.
  • writers - The writers to exchange for PooledWriters.

Shutdown all pool resources and close all channels.

Ideally the PooledWriters should all have been flushed first, that is up to the user. Any further attempts to send to the Pool will return an error.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.