[][src]Struct wd_event::task_pool::TaskEntity

pub struct TaskEntity { /* fields omitted */ }

Implementations

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 + Send + Sync + 'static>>>,
    now: Arc<AtomicU32>,
    status: Arc<AtomicBool>,
    max: u32,
    min: u32
)
[src]

pub fn make_worker(&self)[src]

pub fn run(&self, f: Arc<dyn Task + Send + Sync + 'static>) -> usize[src]

立即发送到执行队列,如果限定了max,则有可能造成堆积,导致内存暴增

pub async fn run_ease<'_>(&'_ self, f: Arc<dyn Task + Send + Sync + 'static>)[src]

如果当前堆积任务过多超过预定闸值则缓解发送

pub fn close(&self)[src]

关闭任务池并将已存在的任务执行完毕

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.