pub struct ProcessHandle { /* private fields */ }Expand description
Handle to an in-flight streaming run. Caller stores it (e.g. in a
runId-keyed map) so a later cancel() can find it.
Dropping the handle does NOT cancel the run — the reader threads +
wait thread continue independently. Use cancel() explicitly when
the user closes the connection.
Implementations§
Source§impl ProcessHandle
impl ProcessHandle
Sourcepub fn cancel(&self) -> Result<(), StreamError>
pub fn cancel(&self) -> Result<(), StreamError>
SIGTERM the process, then SIGKILL after 1.5s if it’s still alive. The CLI is supposed to flush a final result on SIGTERM but we don’t trust it to do so forever.
Sourcepub fn was_cancelled(&self) -> bool
pub fn was_cancelled(&self) -> bool
Whether cancel() was called. Tagged on the final Exited event.
Trait Implementations§
Source§impl Clone for ProcessHandle
impl Clone for ProcessHandle
Source§fn clone(&self) -> ProcessHandle
fn clone(&self) -> ProcessHandle
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 moreAuto Trait Implementations§
impl Freeze for ProcessHandle
impl RefUnwindSafe for ProcessHandle
impl Send for ProcessHandle
impl Sync for ProcessHandle
impl Unpin for ProcessHandle
impl UnsafeUnpin for ProcessHandle
impl UnwindSafe for ProcessHandle
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