pub trait Runner: Send + Sync {
// Required methods
fn runner_id(&self) -> &RunnerId;
fn runner_cls(&self) -> &str;
fn max_parallel_slots(&self) -> usize;
fn active_worker_ids(&self) -> Vec<RunnerId>;
fn run<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn run_one<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RustvelloResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn heartbeat<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Runner interface — the task execution engine.
Mirrors pynenc’s BaseRunner. A runner:
- Polls the broker for queued invocations
- Loads invocation data from the state backend
- Executes the task function
- Stores results and updates status
Required Methods§
Sourcefn runner_cls(&self) -> &str
fn runner_cls(&self) -> &str
Human-readable runner class name (e.g., “PersistentTokioRunner”).
Sourcefn max_parallel_slots(&self) -> usize
fn max_parallel_slots(&self) -> usize
Maximum number of parallel execution slots.
Sourcefn active_worker_ids(&self) -> Vec<RunnerId>
fn active_worker_ids(&self) -> Vec<RunnerId>
Get runner_ids of currently active workers.
Sourcefn run<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the runner’s main execution loop. This is a blocking call that runs until shutdown.
Sourcefn run_one<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RustvelloResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run_one<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RustvelloResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform a single iteration of the runner loop.
Returns true if work was done, false if idle.