class documentation

class twisted.internet.process._BaseProcess(BaseProcess): (source)

Known subclasses: twisted.internet.process.Process, twisted.internet.process.PTYProcess

View In Hierarchy

Base class for Process and PTYProcess.

Instance Variable status Undocumented
Instance Variable pid Undocumented
Method reapProcess Try to reap a process (without blocking) via waitpid.
Method signalProcess No summary
Method __repr__ String representation of a process.
Method _getReason Undocumented
Method _resetSignalDisposition Undocumented
Method _fork Fork and then exec sub-process.
Method _setupChild Setup the child process. Override in subclasses.
Method _execChild The exec() which is done in the forked child.

Inherited from BaseProcess:

Class Variable lostProcess Undocumented
Instance Variable proto Undocumented
Method __init__ Undocumented
Method processEnded This is called when the child terminates.
Method maybeCallProcessEnded Call processEnded on protocol after final cleanup.
Method _callProcessExited Undocumented
def reapProcess(self): (source)

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.)

def _getReason(self, status): (source)

Undocumented

def signalProcess(self, signalID): (source)

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

ParameterssignalIDUndocumented (type: str or int)
def _resetSignalDisposition(self): (source)

Undocumented

def _fork(self, path, uid, gid, executable, args, environment, **kwargs): (source)

Fork and then exec sub-process.

Parameterspaththe path where to run the new process. (type: bytes or unicode)
uidif defined, the uid used to run the new process. (type: int)
gidif defined, the gid used to run the new process. (type: int)
executablethe executable to run in a new process. (type: str)
argsarguments used to create the new process. (type: list.)
environmentenvironment used for the new process. (type: dict.)
kwargskeyword arguments to _setupChild method.
def _setupChild(self, *args, **kwargs): (source)

Setup the child process. Override in subclasses.

def _execChild(self, path, uid, gid, executable, args, environment): (source)

The exec() which is done in the forked child.

def __repr__(self): (source)

String representation of a process.

ReturnsUndocumented (type: str)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.