pub(crate) struct PlanScheduler {
input: PlanInput,
execution: Vec<Execution>,
atlas: AtlasClient,
provider_id: String,
runtime: PlanRuntime,
verification: Arc<VerificationPolicy>,
tx: Sender<Result<RtdlEvent, Status>>,
tasks: JoinSet<Completion>,
cancelled: bool,
error: Option<Status>,
}Expand description
Own one plan’s scheduling state and tasks until all work has been drained.
Fields§
§input: PlanInputValidated plan input and the closure state of its operators.
execution: Vec<Execution>Scheduling progress indexed by the corresponding node’s arena position.
atlas: AtlasClientAtlas connection cloned for capability dispatch and cancellation.
provider_id: StringExecutor’s own provider ID used for consumer identity and builtin dispatch.
runtime: PlanRuntimeShared active-plan state used to publish progress and observe cancellation.
verification: Arc<VerificationPolicy>Rules and timing policy for verification of successful capability results.
tx: Sender<Result<RtdlEvent, Status>>Sends execution events or a terminal error to the requesting RPC stream.
tasks: JoinSet<Completion>In-flight capability calls and verification waits drained before plan cleanup.
cancelled: boolWhether this scheduler has begun cancellation and sealed further input.
error: Option<Status>Input, transport, or task error retained for reporting after cleanup.
Implementations§
Source§impl PlanScheduler
impl PlanScheduler
Sourcepub(crate) async fn start(
atlas: AtlasClient,
provider_id: String,
runtime: PlanRuntime,
verification: Arc<VerificationPolicy>,
input: PlanInput,
stream: impl Stream<Item = Result<ExecuteStreamInput, Status>> + Unpin + Send + 'static,
) -> Result<ReceiverStream<Result<RtdlEvent, Status>>, Status>
pub(crate) async fn start( atlas: AtlasClient, provider_id: String, runtime: PlanRuntime, verification: Arc<VerificationPolicy>, input: PlanInput, stream: impl Stream<Item = Result<ExecuteStreamInput, Status>> + Unpin + Send + 'static, ) -> Result<ReceiverStream<Result<RtdlEvent, Status>>, Status>
Reserve active state before returning headers and own all work until cleanup finishes.
Sourceasync fn cancel(&mut self)
async fn cancel(&mut self)
Seal input on cancellation or transport loss and retain ownership until all work drains.
Sourcefn permitted(&self, index: usize) -> (bool, bool)
fn permitted(&self, index: usize) -> (bool, bool)
Return whether the parent permits execution and whether an earlier sequence child failed.
Sourceasync fn advance_control(&mut self, index: usize) -> bool
async fn advance_control(&mut self, index: usize) -> bool
Select the next child only after the current one and its verification have finished.
async fn finish_operator( &mut self, index: usize, ctx: &NodeEventContext, failed: bool, )
Sourceasync fn schedule(&mut self) -> bool
async fn schedule(&mut self) -> bool
Advance runnable nodes and closed operators; report transitions that may unlock more work.
Sourceasync fn run(
self,
stream: impl Stream<Item = Result<ExecuteStreamInput, Status>> + Unpin,
)
async fn run( self, stream: impl Stream<Item = Result<ExecuteStreamInput, Status>> + Unpin, )
Consume input and task results concurrently, cleaning up on EOF, cancellation, and errors.
Auto Trait Implementations§
impl !Freeze for PlanScheduler
impl !RefUnwindSafe for PlanScheduler
impl !UnwindSafe for PlanScheduler
impl Send for PlanScheduler
impl Sync for PlanScheduler
impl Unpin for PlanScheduler
impl UnsafeUnpin for PlanScheduler
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].