pub trait WorkerPool: Send + Sync {
// Required methods
fn acquire(&self, resource_tag: Option<&str>) -> bool;
fn release(&self, resource_tag: Option<&str>);
// Provided methods
fn add_resource(&self, _tag: &str) { ... }
fn remove_resource(&self, _tag: &str) { ... }
}Expand description
Trait for managing available execution slots.
The executor calls acquire before dispatching a task and
release when the task completes.
Required Methods§
Provided Methods§
Sourcefn add_resource(&self, _tag: &str)
fn add_resource(&self, _tag: &str)
Add a resource to the pool (for dynamic pools).
Sourcefn remove_resource(&self, _tag: &str)
fn remove_resource(&self, _tag: &str)
Remove a resource from the pool (for dynamic pools).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".