Struct wd_run::TaskEntity [−][src]
pub struct TaskEntity { /* fields omitted */ }
Implementations
impl TaskEntity
[src]
impl TaskEntity
[src]pub fn new(t: TaskPoolType, cache: usize) -> TaskEntity
[src]
pub fn init(&self)
[src]
pub async fn init_task_pool(&'_ self)
[src]
pub async fn worker(
receiver: Arc<SegQueue<Arc<dyn Task + 'static + Send + Sync>>>,
now: Arc<AtomicU32>,
status: Arc<AtomicBool>,
max: u32,
min: u32
)
[src]
receiver: Arc<SegQueue<Arc<dyn Task + 'static + Send + Sync>>>,
now: Arc<AtomicU32>,
status: Arc<AtomicBool>,
max: u32,
min: u32
)
pub fn make_worker(&self)
[src]
pub fn run(&self, f: Arc<dyn Task + 'static + Send + Sync>) -> usize
[src]
pub fn run(&self, f: Arc<dyn Task + 'static + Send + Sync>) -> usize
[src]立即发送到执行队列,如果限定了max,则有可能造成堆积,导致内存暴增
pub async fn close_timeout(&'_ self, timeout: Duration)
[src]
pub async fn close_timeout(&'_ self, timeout: Duration)
[src]不再接受任务,处理完剩余任务后返回,或者超时返回