pub struct AsyncCtx { /* private fields */ }Expand description
A type that can affect the logical event queue to implement asynchronous physical actions. This is a “link” to the event system, from the outside world.
Implementations§
Source§impl AsyncCtx
impl AsyncCtx
Sourcepub fn was_terminated(&self) -> bool
pub fn was_terminated(&self) -> bool
Returns true if the scheduler has been shutdown. When that’s true, calls to other methods of this type will fail with [SendError].
Sourcepub fn request_stop(&mut self, offset: Offset) -> Result<(), SendError<()>>
pub fn request_stop(&mut self, offset: Offset) -> Result<(), SendError<()>>
Request that the application shutdown, possibly with a particular offset from the current physical time.
This may fail if this is called while the scheduler has already been shutdown. An Ok result is also not a guarantee that the event will be processed: the scheduler may be in the process of shutting down, or its shutdown might be programmed for a logical time which precedes the current physical time.
Sourcepub fn schedule_physical<T: Sync>(
&mut self,
action: &PhysicalActionRef<T>,
offset: Offset,
) -> Result<(), SendError<Option<T>>>
pub fn schedule_physical<T: Sync>( &mut self, action: &PhysicalActionRef<T>, offset: Offset, ) -> Result<(), SendError<Option<T>>>
Schedule an action to run after its own implicit time delay plus an optional additional time delay. These delays are in logical time.
Note that this locks the action.
This may fail if this is called while the scheduler has already been shutdown. An Ok result is also not a guarantee that the event will be processed: the scheduler may be in the process of shutting down, or its shutdown might be programmed for a logical time which precedes the current physical time.
Sourcepub fn schedule_physical_with_v<T: Sync>(
&mut self,
action: &PhysicalActionRef<T>,
value: Option<T>,
offset: Offset,
) -> Result<(), SendError<Option<T>>>
pub fn schedule_physical_with_v<T: Sync>( &mut self, action: &PhysicalActionRef<T>, value: Option<T>, offset: Offset, ) -> Result<(), SendError<Option<T>>>
Schedule an action to run after its own implicit time delay plus an optional additional time delay. These delays are in logical time.
Note that this locks the action.
This may fail if this is called while the scheduler has already been shutdown. An Ok result is also not a guarantee that the event will be processed: the scheduler may be in the process of shutting down, or its shutdown might be programmed for a logical time which precedes the current physical time.