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 !UnwindSafe for InternalSlowJobPool
impl Freeze for InternalSlowJobPool
impl Send for InternalSlowJobPool
impl Sync for InternalSlowJobPool
impl Unpin for InternalSlowJobPool
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> Event for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more