pub trait Action: Send + Sync {
// Required methods
fn id(&self) -> ActionId;
fn deps(&self) -> Vec<ActionId>;
fn input_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<Sha256, BuildError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<BuildOutput, BuildError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn is_coordinator(&self) -> bool { ... }
}Expand description
Represents an executable action within the repolith graph.
Actions are the fundamental units of work. They declare their dependencies, compute their input state, and execute their logic.
Note: Long-running execute implementations should periodically poll
ctx.cancel.is_cancelled() to support graceful termination.
Required Methods§
Sourcefn input_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<Sha256, BuildError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn input_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<Sha256, BuildError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Computes the hash representing the input state of this action. This is used for caching and determining if the action needs to run.
Sourcefn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<BuildOutput, BuildError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<BuildOutput, BuildError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Executes the action’s core logic.
Provided Methods§
Sourcefn is_coordinator(&self) -> bool
fn is_coordinator(&self) -> bool
true for actions that only coordinate other actions (federation’s
RepolithSync) rather than doing bounded work themselves.
The orchestrator does not charge a concurrency permit for
coordinators: the child actions they spawn acquire from the same
shared semaphore, so charging the coordinator too would deadlock at
--jobs 1 (the coordinator would hold the only permit while its
children wait for it).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".