Struct NoTimerQueue
pub struct NoTimerQueue<I>(/* private fields */);Expand description
选择省略定时任务队列(timer task queue)。类型参数与执行器(executor)的时钟(clock)时刻匹配。 普通定时派发(timed task dispatch)要求真实的定时来源。
ⓘ
use pi_async_executor::{routing::LocalReadySubmit, ExecutorHandle, NoIdleQueue, NoTimerQueue};
use pi_async_runtime_core::TaskConfig;
use pi_async_task_queue::MpscTaskQueueHandle;
use std::time::Duration;
fn unavailable<L: LocalReadySubmit>(handle: &ExecutorHandle<MpscTaskQueueHandle, NoIdleQueue, NoTimerQueue<()>, L>) {
handle.spawn_timing(async {}, Duration::ZERO, TaskConfig::<()>::default());
}本地定时派发也要求真实的定时来源。
ⓘ
use pi_async_executor::{routing::LocalReadySubmit, ExecutorHandle, ExecutorLocal, NoIdleQueue, NoTimerQueue};
use pi_async_runtime_core::TaskConfig;
use pi_async_task_queue::MpscTaskQueueHandle;
use std::time::Duration;
fn unavailable<L: LocalReadySubmit>(handle: &ExecutorHandle<MpscTaskQueueHandle, NoIdleQueue, NoTimerQueue<()>, L>, local: &ExecutorLocal<NoTimerQueue<()>>) {
handle.spawn_timing_local(local, async {}, Duration::ZERO, TaskConfig::<()>::default());
}ⓘ
use pi_async_executor::{ExecutorLocal, NoTimerQueue};
fn unavailable(local: &ExecutorLocal<NoTimerQueue<()>>) {
local.try_push_timer((), ());
}Trait Implementations§
Auto Trait Implementations§
impl<I> Forget for NoTimerQueue<I>
impl<I> Freeze for NoTimerQueue<I>
impl<I> Move for NoTimerQueue<I>
impl<I> RefUnwindSafe for NoTimerQueue<I>
impl<I> Send for NoTimerQueue<I>
impl<I> Sync for NoTimerQueue<I>
impl<I> Unpin for NoTimerQueue<I>
impl<I> UnsafeUnpin for NoTimerQueue<I>
impl<I> UnwindSafe for NoTimerQueue<I>
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