pub trait ThreadPooler: Spawner + Metrics {
// Required method
fn create_thread_pool(
&self,
concurrency: NonZeroUsize,
) -> Result<ThreadPool, ThreadPoolBuildError>;
// Provided method
fn create_strategy(
&self,
concurrency: NonZeroUsize,
) -> Result<Rayon, ThreadPoolBuildError> { ... }
}Expand description
Required Methods§
Sourcefn create_thread_pool(
&self,
concurrency: NonZeroUsize,
) -> Result<ThreadPool, ThreadPoolBuildError>
fn create_thread_pool( &self, concurrency: NonZeroUsize, ) -> Result<ThreadPool, ThreadPoolBuildError>
Creates a clone-able rayon-compatible thread pool with Spawner::spawn.
§Arguments
concurrency: The number of tasks to execute concurrently in the pool.
§Returns
A Result containing the configured rayon::ThreadPool or a rayon::ThreadPoolBuildError if the pool cannot
be built.
Provided Methods§
Sourcefn create_strategy(
&self,
concurrency: NonZeroUsize,
) -> Result<Rayon, ThreadPoolBuildError>
fn create_strategy( &self, concurrency: NonZeroUsize, ) -> Result<Rayon, ThreadPoolBuildError>
Creates a clone-able Rayon strategy for use with commonware_parallel.
§Arguments
concurrency: The number of tasks to execute concurrently in the pool.
§Returns
A Result containing the configured Rayon strategy or a rayon::ThreadPoolBuildError if the pool cannot be
built.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl ThreadPooler for commonware_runtime::deterministic::Context
impl ThreadPooler for commonware_runtime::tokio::Context
Available on neither
commonware_stability_GAMMA nor commonware_stability_DELTA nor commonware_stability_EPSILON nor commonware_stability_RESERVED.impl<C> ThreadPooler for Cell<C>where
C: ThreadPooler,
Available on neither
commonware_stability_GAMMA nor commonware_stability_DELTA nor commonware_stability_EPSILON nor commonware_stability_RESERVED.