Struct veloren_common::slowjob::InternalSlowJobPool
source · struct InternalSlowJobPool {
next_id: u64,
queue: HashMap<String, VecDeque<Queue>>,
configs: HashMap<String, Config>,
last_spawned_configs: Vec<String>,
global_spawned_and_running: u64,
global_limit: u64,
jobs_metrics_cnt: usize,
jobs_metrics: HashMap<String, Vec<JobMetrics>>,
threadpool: Arc<ThreadPool>,
internal: Option<Arc<Mutex<Self>>>,
}
Fields§
§next_id: u64
§queue: HashMap<String, VecDeque<Queue>>
§configs: HashMap<String, Config>
§last_spawned_configs: Vec<String>
§global_spawned_and_running: u64
§global_limit: u64
§jobs_metrics_cnt: usize
§jobs_metrics: HashMap<String, Vec<JobMetrics>>
§threadpool: Arc<ThreadPool>
§internal: Option<Arc<Mutex<Self>>>
Implementations§
source§impl InternalSlowJobPool
impl InternalSlowJobPool
pub fn new( global_limit: u64, jobs_metrics_cnt: usize, _threadpool: Arc<ThreadPool> ) -> Arc<Mutex<Self>>
sourcefn calc_queued_order(
&self,
queued: HashMap<&String, u64>,
limit: usize
) -> Vec<String>
fn calc_queued_order( &self, queued: HashMap<&String, u64>, limit: usize ) -> Vec<String>
returns order of configuration which are queued next
fn can_spawn(&self, name: &str) -> bool
pub fn spawn<F>(&mut self, name: &str, f: F) -> SlowJob
fn finish(&mut self, name: &str, metrics: JobMetrics)
fn spawn_queued(&mut self)
pub fn take_metrics(&mut self) -> HashMap<String, Vec<JobMetrics>>
Auto Trait Implementations§
impl !RefUnwindSafe for InternalSlowJobPool
impl Send for InternalSlowJobPool
impl Sync for InternalSlowJobPool
impl Unpin for InternalSlowJobPool
impl !UnwindSafe for InternalSlowJobPool
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more