Struct task_queue::spawn_policy::DynamicSpawnPolicy
[−]
[src]
pub struct DynamicSpawnPolicy { /* fields omitted */ }
Policy that provide dynamic number of threads for queue.
Examples
extern crate task_queue; let mut queue = task_queue::TaskQueue::new(); let boxed_policy = Box::new(task_queue::spawn_policy::DynamicSpawnPolicy::new()); queue.set_spawn_policy(boxed_policy);
Methods
impl DynamicSpawnPolicy
[src]
fn new() -> Self
Create policy that provide dynamic number of threads for queue. Policy will trying to change number of threads every 5 minutes.
fn with_delta(delta: Duration) -> Self
Create policy that provide dynamic number of threads for queue. Policy will trying to change number of threads no more often delta.
Trait Implementations
impl SpawnPolicy for DynamicSpawnPolicy
[src]
fn get_count(&mut self, stats: TaskQueueStats) -> usize
Returns current number of threads.