Skip to main content

NodeFacade

Struct NodeFacade 

Source
pub struct NodeFacade {
Show 15 fields pub node_id: String, pub graph_id: String, pub generation: u64, pub work_role: String, pub lifecycle_state: NodeLifecycleState, pub capabilities: BTreeSet<NodeCapability>, pub adapter: Arc<dyn NodeCapabilityAdapter>, pub session_id: Option<String>, pub session_registry: Option<SingleWriterSessionRegistry>, pub active_invocation: Option<NodeInvocation>, pub invocation_history: Vec<InvocationRecord>, pub durable_cursor: u64, pub stop_requested: bool, pub cancellation_facts: Option<CancellationFacts>, pub follow_up_instructions: Vec<String>,
}
Expand description

Facade presenting one uniform control surface for a node instance.

Fields§

§node_id: String§graph_id: String§generation: u64§work_role: String§lifecycle_state: NodeLifecycleState§capabilities: BTreeSet<NodeCapability>§adapter: Arc<dyn NodeCapabilityAdapter>§session_id: Option<String>§session_registry: Option<SingleWriterSessionRegistry>§active_invocation: Option<NodeInvocation>§invocation_history: Vec<InvocationRecord>§durable_cursor: u64§stop_requested: bool§cancellation_facts: Option<CancellationFacts>§follow_up_instructions: Vec<String>

Implementations§

Source§

impl NodeFacade

Source

pub fn new( node_id: impl Into<String>, graph_id: impl Into<String>, generation: u64, work_role: impl Into<String>, adapter: Arc<dyn NodeCapabilityAdapter>, session_id: Option<String>, session_registry: Option<SingleWriterSessionRegistry>, ) -> NodeFacade

Source

pub fn metadata(&self) -> NodeMetadata

Snapshot node metadata for registration and feature indexing.

Source

pub fn steer( &mut self, invocation_id: &str, instruction: &str, follow_up: bool, ) -> Result<SteerResult, NodeExecutionError>

Steer the active invocation with new instructions. Truthfully reports whether live in-flight steering was applied, follow-up was queued for safe boundary, or steering is unsupported. Never kills or restarts the process!

Source

pub fn pause(&mut self) -> Result<PauseResult, NodeExecutionError>

Request pause / drain for this node. In-flight work may suspend if supported, or drain to safe boundary. Never fakes pause by killing processes.

Source

pub fn observe_safe_boundary(&mut self)

Mark that a safe boundary has been observed for this node. Converts PauseRequested to Paused.

Source

pub fn resume(&mut self) -> Result<ResumeResult, NodeExecutionError>

Resume a paused or waiting node.

Source

pub fn stop(&mut self, reason: &str) -> Result<StopResult, NodeExecutionError>

Cooperatively stop this node. Preserves requested, acknowledged, and effect-unknown facts separately.

Source

pub fn observe(&self) -> NodeObservation

Observe current node state without starting or extending work.

Source

pub fn settle_invocation_completion( &mut self, outcome: NodeExecutionOutcome, cursor: u64, ) -> Result<NodeExecutionReceipt, NodeExecutionError>

Settle an active invocation completion, issuing a durable execution receipt.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.