Skip to main content

PluginRunner

Trait PluginRunner 

Source
pub trait PluginRunner: Plugin {
    // Required method
    fn run_task<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        task: &'life1 TaskDefinition,
        hosts: &'life2 Hosts,
        connection_resolver: Option<Arc<dyn TaskConnectionResolver>>,
        runner_config: &'life3 RunnerConfig,
        max_depth: usize,
    ) -> Pin<Box<dyn Future<Output = Result<TaskResults, GenjaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;

    // Provided methods
    fn run_tasks<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        tasks: &'life1 Tasks,
        hosts: &'life2 Hosts,
        connection_resolver: Option<Arc<dyn TaskConnectionResolver>>,
        runner_config: &'life3 RunnerConfig,
        max_depth: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskResults>, GenjaError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
    fn group(&self) -> String { ... }
}
Expand description

Executes tasks against a set of hosts.

Runner plugins provide task execution for a given inventory and task list. Implementers should be safe to call from multiple threads and should avoid mutating shared state without synchronization.

Required Methods§

Source

fn run_task<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, task: &'life1 TaskDefinition, hosts: &'life2 Hosts, connection_resolver: Option<Arc<dyn TaskConnectionResolver>>, runner_config: &'life3 RunnerConfig, max_depth: usize, ) -> Pin<Box<dyn Future<Output = Result<TaskResults, GenjaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Run a single task against the provided hosts.

Provided Methods§

Source

fn run_tasks<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, tasks: &'life1 Tasks, hosts: &'life2 Hosts, connection_resolver: Option<Arc<dyn TaskConnectionResolver>>, runner_config: &'life3 RunnerConfig, max_depth: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskResults>, GenjaError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Run all tasks in the provided task list against the provided hosts.

The default implementation preserves the order of tasks, executing each root task tree by delegating to Self::run_task. Runners can override this when they need custom batching behavior.

Source

fn group(&self) -> String

Returns the group name

Trait Implementations§

Source§

impl Debug for dyn PluginRunner

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§