Skip to main content

ChildRunLaunchHook

Trait ChildRunLaunchHook 

Source
pub trait ChildRunLaunchHook: Send + Sync {
    // Required method
    fn before_child_launch(
        &self,
        job: &SpawnJob,
        child_events: Sender<AgentEvent>,
    );

    // Provided methods
    fn before_queued_dequeue(&self, _job: &SpawnJob) -> BoxFuture<'static, ()> { ... }
    fn before_queued_reservation(
        &self,
        _job: &SpawnJob,
    ) -> BoxFuture<'static, ()> { ... }
}
Expand description

Optional application-layer preparation for a child run launched through the canonical scheduler.

The engine owns runner reservation and execution. Applications may use this synchronous, no-fail hook to attach observers to the already-created child event sender (for example, the server’s always-on notification relay) without introducing an engine dependency on application services.

Required Methods§

Source

fn before_child_launch(&self, job: &SpawnJob, child_events: Sender<AgentEvent>)

Provided Methods§

Source

fn before_queued_dequeue(&self, _job: &SpawnJob) -> BoxFuture<'static, ()>

Optional queue boundary observer. The production notification hook is a no-op; deterministic scheduler tests can hold dequeue before the cancellation fence is acquired.

Source

fn before_queued_reservation(&self, _job: &SpawnJob) -> BoxFuture<'static, ()>

Optional observer inside the cancellation fence, immediately before runner reservation. It must never make a model decision or perform unbounded work while this guard is held.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§