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§
Sourcefn channel(&self) -> Arc<dyn ExecutorChannel>
fn channel(&self) -> Arc<dyn ExecutorChannel>
Get a channel that can add new items for the executor to run.
Sourcefn spin(&mut self, conditions: SpinConditions) -> Vec<RclrsError>
fn spin(&mut self, conditions: SpinConditions) -> Vec<RclrsError>
Tell the runtime to spin while blocking any further execution until the spinning is complete.
Sourcefn spin_async(
self: Box<Self>,
conditions: SpinConditions,
) -> BoxFuture<'static, (Box<dyn ExecutorRuntime>, Vec<RclrsError>)>
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.