pub struct ExecutionCoordinator { /* private fields */ }Implementations§
Source§impl ExecutionCoordinator
impl ExecutionCoordinator
pub fn new( journal: Arc<dyn ExecutionJournal>, instance_resolver: Arc<dyn RuntimeInstanceResolver>, session_factory: Arc<dyn ExecutionSessionFactory>, definition_resolver: Arc<dyn AgentDefinitionResolver>, kernel: Arc<dyn RuntimeKernel>, max_concurrent_executions: usize, ) -> Result<Self, LinkError>
pub fn new_with_context_limits( journal: Arc<dyn ExecutionJournal>, instance_resolver: Arc<dyn RuntimeInstanceResolver>, session_factory: Arc<dyn ExecutionSessionFactory>, definition_resolver: Arc<dyn AgentDefinitionResolver>, kernel: Arc<dyn RuntimeKernel>, max_concurrent_executions: usize, context_limits: ContextLimits, ) -> Result<Self, LinkError>
Sourcepub async fn recover(&self, limit: usize) -> Result<usize, LinkError>
pub async fn recover(&self, limit: usize) -> Result<usize, LinkError>
Claim and recover work left by a crashed host. Queued executions with a durable delegation are resumed; executions interrupted after starting are safely finalized without replaying unknown side effects.
Sourcepub fn start_recovery_loop(
&self,
interval: Duration,
batch_size: usize,
) -> Result<(), LinkError>
pub fn start_recovery_loop( &self, interval: Duration, batch_size: usize, ) -> Result<(), LinkError>
Keep scanning after startup so a row whose prior worker claim had not yet expired at boot is recovered once the short lease elapses.
Sourcepub fn begin_shutdown(&self)
pub fn begin_shutdown(&self)
Stop admission and close the task scope so shutdown can wait for every execution spawned by this coordinator.
Sourcepub async fn shutdown(&self, grace: Duration) -> bool
pub async fn shutdown(&self, grace: Duration) -> bool
Drain active executions within grace. On expiry, propagate
cancellation to every registered execution and wait for cleanup.
pub fn active_executions(&self) -> usize
Trait Implementations§
Source§impl Clone for ExecutionCoordinator
impl Clone for ExecutionCoordinator
Source§fn clone(&self) -> ExecutionCoordinator
fn clone(&self) -> ExecutionCoordinator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl RuntimeLink for ExecutionCoordinator
impl RuntimeLink for ExecutionCoordinator
fn create_execution<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
authority: &'life1 RequestAuthority,
idempotency_key: &'life2 str,
request: CreateExecutionRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateExecutionResponse, LinkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execution<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
authority: &'life1 RequestAuthority,
id: &'life2 ExecutionId,
) -> Pin<Box<dyn Future<Output = Result<ExecutionView, LinkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn events<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
authority: &'life1 RequestAuthority,
id: &'life2 ExecutionId,
after: Option<u64>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<EventPage, LinkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn submit_input<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
authority: &'life1 RequestAuthority,
id: &'life2 ExecutionId,
request: SubmitInputRequest,
) -> Pin<Box<dyn Future<Output = Result<ExecutionView, LinkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn cancel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
authority: &'life1 RequestAuthority,
id: &'life2 ExecutionId,
) -> Pin<Box<dyn Future<Output = Result<ExecutionView, LinkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for ExecutionCoordinator
impl !UnwindSafe for ExecutionCoordinator
impl Freeze for ExecutionCoordinator
impl Send for ExecutionCoordinator
impl Sync for ExecutionCoordinator
impl Unpin for ExecutionCoordinator
impl UnsafeUnpin for ExecutionCoordinator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more