pub struct ProcessControl { /* private fields */ }Expand description
Cloneable interrupt control for exactly one ProcessSubscription run.
Keep the handle in the model, rebuilding subscriptions with clones. Tag
process messages with generation to reject delayed
messages after a restart. Use a fresh handle for each new run. Dropping a
descriptor or a handle clone does not close an active run.
Requests never wait for child I/O or model/stdin queue capacity. The owning
supervisor sends SIGINT to the immediate child on Unix, without a shell or
process-group signal. Linux requires a retained pidfd; if unavailable,
delivery fails instead of falling back to a potentially reused PID. Other
Unix platforms require the supervisor to remain the child’s sole reaper.
A ProcessSubscription::pty run is the exception: SIGINT goes to the
child’s whole process group, as Ctrl-C does in a terminal, and
request_resize resizes its PTY.
Implementations§
Source§impl ProcessControl
impl ProcessControl
Sourcepub const fn generation(&self) -> u64
pub const fn generation(&self) -> u64
Stable identity shared by clones; fresh handles have distinct identities.
Sourcepub fn status(&self) -> ProcessControlStatus
pub fn status(&self) -> ProcessControlStatus
Read one consistent snapshot. A closed handle need not mean output drained.
Sourcepub fn request_interrupt(&self) -> Result<(), ProcessControlError>
pub fn request_interrupt(&self) -> Result<(), ProcessControlError>
Admit one interrupt for the supervisor to deliver.
Admission is not delivery. Read status for the outcome;
even Sent does not imply that a child handler ran or the child exited.
Sourcepub fn request_resize(
&self,
cols: u16,
rows: u16,
) -> Result<(), ProcessControlError>
pub fn request_resize( &self, cols: u16, rows: u16, ) -> Result<(), ProcessControlError>
Ask the supervisor to resize this run’s PTY to cols x rows cells.
The latest request replaces a pending one. A request made before the
child spawns sets its initial size. Otherwise the supervisor applies it
within one 50 ms poll, then sends SIGWINCH to the child’s process group.
Zero dimensions become one. Runs without ProcessSubscription::pty
ignore resizes, and admission does not report whether one was applied.
Sourcepub fn pending_resize(&self) -> Option<(u16, u16)>
pub fn pending_resize(&self) -> Option<(u16, u16)>
The (cols, rows) a request_resize has yet
to apply, if any: before spawn, the size the PTY will start at.