Struct wd_run::TaskEntity[][src]

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 + 'static + Send + Sync>>>,
    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 + 'static + Send + Sync>) -> usize[src]

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

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

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

pub fn close(&self)[src]

立即停止任务,剩余任务不再执行

pub async fn close_timeout(&'_ self, timeout: Duration)[src]

不再接受任务,处理完剩余任务后返回,或者超时返回

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.