use pi_async_runtime_core::{
definitions::RuntimeId,
time::{TimerAccess, TimerEntry},
};
use pi_async_task_queue::{
management::QueueCleanupProgress,
timer::{TimerSubmitError, TimerTaskQueue},
};
use pi_clock_manual::global::GlobalManualInstant;
pub trait LocalTimerSubmit<Item>: 'static {
fn try_push_local(
runtime: RuntimeId,
deadline: GlobalManualInstant,
item: Item,
) -> pi_result::RawResult<pi_async_task_queue::CancelTimerKey, TimerSubmitError<Item>>;
}
pub trait ExecutorTimer:
TimerTaskQueue<
Item = TimerEntry<
<Self as TimerTaskQueue>::Key,
<<Self as ExecutorTimer>::Access as TimerAccess>::Registration,
>,
>
{
type Access: TimerAccess<
Instant = <Self as TimerTaskQueue>::Instant,
Key = <Self as TimerTaskQueue>::Key,
>;
fn timer_access(&self) -> Self::Access;
fn process_cancel_retries(&mut self) -> pi_result::Result<QueueCleanupProgress>;
}