Struct task_queue::spawn_policy::ManualSpawnPolicy
[−]
[src]
pub struct ManualSpawnPolicy { /* fields omitted */ }
Policy that makes it possible control of the threads number manually
Examples
extern crate task_queue; let mut queue = task_queue::TaskQueue::new(); let mut policy = task_queue::spawn_policy::ManualSpawnPolicy::new(); let mut controller = policy.get_controller(); queue.set_spawn_policy(Box::new(policy)); controller.add_thread();
Methods
impl ManualSpawnPolicy
[src]
fn new() -> Self
Create policy with 10 threads
fn with_threads(threads: usize) -> Self
Create policy with selected number of threads
fn get_controller(&mut self) -> ManualSpawnPolicyController
Returns controller which makes possible control of the threads number
Trait Implementations
impl SpawnPolicy for ManualSpawnPolicy
[src]
fn get_count(&mut self, stats: TaskQueueStats) -> usize
Returns current number of threads.