pub struct RunningProcess {
pub process: Process,
/* private fields */
}Expand description
A process that is currently running and being monitored.
§Fork Safety
This handle contains both a PID and owned file descriptors for process I/O.
Upon fork, the descriptors are inherited. Standard O_CLOEXEC behavior
applies after exec.
Fields§
§process: ProcessHandle to the process.
Implementations§
Source§impl RunningProcess
impl RunningProcess
Sourcepub fn register_with_reactor(
&mut self,
reactor: &mut Reactor,
) -> Result<(), CoreError>
pub fn register_with_reactor( &mut self, reactor: &mut Reactor, ) -> Result<(), CoreError>
Register active stdio pipe descriptors with a reactor.
Call this once after spawn_start when the process was started with
captured output or stdin data. The assigned tokens are kept internally
and later matched by Self::handle_reactor_event.
Sourcepub fn handle_reactor_event(
&mut self,
reactor: &mut Reactor,
event: &Event,
) -> Result<(), CoreError>
pub fn handle_reactor_event( &mut self, reactor: &mut Reactor, event: &Event, ) -> Result<(), CoreError>
Apply one reactor readiness event to this process’ stdio drain state.
Events for unrelated tokens are ignored. Callers remain responsible for
waiting on Self::process and driving the reactor until Self::io_done
returns true.
Sourcepub fn io_done(&self) -> bool
pub fn io_done(&self) -> bool
Return whether all managed stdio pipes have been drained or closed.
Sourcepub fn stdout_paused(&self) -> bool
pub fn stdout_paused(&self) -> bool
Return whether the stdout stream is paused on a full sink queue.
Sourcepub fn stderr_paused(&self) -> bool
pub fn stderr_paused(&self) -> bool
Return whether the stderr stream is paused on a full sink queue.
Sourcepub fn resume_stdout(
&mut self,
reactor: &mut Reactor,
) -> Result<bool, CoreError>
pub fn resume_stdout( &mut self, reactor: &mut Reactor, ) -> Result<bool, CoreError>
Re-deliver the held stdout chunk (if any) and re-register the fd when
the sink has room again. Returns true when the stream is resumed.