ExecutorRuntime

Trait ExecutorRuntime 

Source
pub trait ExecutorRuntime: Send {
    // Required methods
    fn channel(&self) -> Arc<dyn ExecutorChannel>;
    fn spin(&mut self, conditions: SpinConditions) -> Vec<RclrsError>;
    fn spin_async(
        self: Box<Self>,
        conditions: SpinConditions,
    ) -> BoxFuture<'static, (Box<dyn ExecutorRuntime>, Vec<RclrsError>)>;
}
Expand description

This trait defines the interface for having an executor run.

Required Methods§

Source

fn channel(&self) -> Arc<dyn ExecutorChannel>

Get a channel that can add new items for the executor to run.

Source

fn spin(&mut self, conditions: SpinConditions) -> Vec<RclrsError>

Tell the runtime to spin while blocking any further execution until the spinning is complete.

Source

fn spin_async( self: Box<Self>, conditions: SpinConditions, ) -> BoxFuture<'static, (Box<dyn ExecutorRuntime>, Vec<RclrsError>)>

Tell the runtime to spin asynchronously, not blocking the current thread. The runtime instance will be consumed by this function, but it must return itself as the output of the Future that this function returns.

Implementors§