class _BaseProcess(BaseProcess): (source)
Known subclasses: twisted.internet.process.Process
, twisted.internet.process.PTYProcess
Constructor: _BaseProcess(protocol)
Base class for Process and PTYProcess.
Method | __repr__ |
String representation of a process. |
Method | reap |
Try to reap a process (without blocking) via waitpid. |
Method | signal |
Send the given signal signalID to the process. It'll translate a few signals ('HUP', 'STOP', 'INT', 'KILL', 'TERM') from a string representation to its int value, otherwise it'll pass directly the value provided... |
Instance Variable | pid |
Undocumented |
Instance Variable | status |
Undocumented |
Method | _exec |
The exec() which is done in the forked child. |
Method | _fork |
Fork and then exec sub-process. |
Method | _get |
Undocumented |
Method | _reset |
Undocumented |
Method | _setup |
Setup the child process. Override in subclasses. |
Method | _try |
Try to use posix_spawnp() instead of fork(), if possible. |
Inherited from BaseProcess
:
Method | __init__ |
Undocumented |
Method | maybe |
Call processEnded on protocol after final cleanup. |
Method | process |
This is called when the child terminates. |
Class Variable | lost |
Undocumented |
Instance Variable | proto |
Undocumented |
Method | _call |
Undocumented |
Try to reap a process (without blocking) via waitpid.
This is called when sigchild is caught or a Process object loses its "connection" (stdout is closed) This ought to result in reaping all zombie processes, since it will be called twice as often as it needs to be.
(Unfortunately, this is a slightly experimental approach, since UNIX has no way to be really sure that your process is going to go away w/o blocking. I don't want to block.)
Send the given signal signalID to the process. It'll translate a few signals ('HUP', 'STOP', 'INT', 'KILL', 'TERM') from a string representation to its int value, otherwise it'll pass directly the value provided
Parameters | |
signal | Undocumented |
Fork and then exec sub-process.
Parameters | |
path:bytes or unicode | the path where to run the new process. |
uid:int | if defined, the uid used to run the new process. |
gid:int | if defined, the gid used to run the new process. |
executable:str | the executable to run in a new process. |
args:list . | arguments used to create the new process. |
environment:dict . | environment used for the new process. |
**kwargs | keyword arguments to _setupChild method. |
twisted.internet.process.Process
Try to use posix_spawnp() instead of fork(), if possible.
This implementation returns False because the non-PTY subclass implements the actual logic; we can't yet use this for pty processes.
Returns | |
a boolean indicating whether posix_spawnp() was used or not. |