pub struct PythonWorkerSupervisor { /* private fields */ }Expand description
One persistent worker per Python provider. Invocations are deliberately serial; callers receive a stable busy error instead of entering a queue.
Implementations§
Source§impl PythonWorkerSupervisor
impl PythonWorkerSupervisor
Sourcepub fn cancel_active(&self) -> bool
pub fn cancel_active(&self) -> bool
Cooperatively marks the active invocation cancelled, then terminates its complete process tree after a short grace period. The next invocation starts a fresh worker.
Source§impl PythonWorkerSupervisor
impl PythonWorkerSupervisor
Sourcepub fn status(&self) -> PythonWorkerStatus
pub fn status(&self) -> PythonWorkerStatus
Returns a bounded, redacted snapshot without executing provider code.
Source§impl PythonWorkerSupervisor
impl PythonWorkerSupervisor
pub fn new( identity: PythonWorkerIdentity, interpreter: PythonInterpreter, config: PythonSupervisorConfig, ) -> Arc<Self> ⓘ
pub fn new_with_capabilities( identity: PythonWorkerIdentity, interpreter: PythonInterpreter, config: PythonSupervisorConfig, capabilities: &HostCapabilities, ) -> Arc<Self> ⓘ
Sourcepub async fn reset_quarantine(&self)
pub async fn reset_quarantine(&self)
Clears a crash-loop quarantine after an explicit operator action.
Sourcepub fn deactivate(&self)
pub fn deactivate(&self)
Stops new work while allowing an invocation that already owns the worker to complete on this generation.
Sourcepub fn acquire_dispatch(&self) -> bool
pub fn acquire_dispatch(&self) -> bool
Reserves a call while a registry generation is still active.
Sourcepub fn release_dispatch(&self)
pub fn release_dispatch(&self)
Releases a call reservation after the routed invocation completes.
Sourcepub async fn suspend(&self)
pub async fn suspend(&self)
Permanently parks this generation after all already-routed calls drain.
pub async fn preflight(&self) -> Result<Value, PythonSupervisorError>
pub async fn invoke( &self, provider: &str, action: &str, arguments: Value, surface: ProviderSurface, snapshot_id: &str, timeout_override: Duration, ) -> Result<Value, PythonSupervisorError>
pub async fn invoke_with_context( &self, provider: &str, action: &str, arguments: Value, options: PythonInvocationOptions<'_>, ) -> Result<Value, PythonSupervisorError>
pub async fn shutdown(&self)
Sourcepub async fn drain_and_shutdown(&self)
pub async fn drain_and_shutdown(&self)
Stop accepting work, then shut the worker down within the configured grace period. Used when a registry generation is retired.
Auto Trait Implementations§
impl !Freeze for PythonWorkerSupervisor
impl !RefUnwindSafe for PythonWorkerSupervisor
impl Send for PythonWorkerSupervisor
impl Sync for PythonWorkerSupervisor
impl Unpin for PythonWorkerSupervisor
impl UnsafeUnpin for PythonWorkerSupervisor
impl !UnwindSafe for PythonWorkerSupervisor
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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more