t.i._.Process(_pollingfile._PollingTimer) : class documentation

Part of twisted.internet._dumbwin32proc View Source View In Hierarchy

Implements interfaces: twisted.internet.interfaces.IConsumer, twisted.internet.interfaces.IProcessTransport, twisted.internet.interfaces.IProducer

A process that integrates with the Twisted event loop.

If your subprocess is a python program, you need to:
Method __init__ Undocumented
Method signalProcess Send a signal to the process.
Method processEnded This is called when the child terminates.
Method write Write data to the process' stdin.
Method writeSequence Write data to the process' stdin.
Method closeChildFD Close a file descriptor which is connected to the child process, identified by its FD in the child process.
Method closeStdin Close the process' stdin.
Method closeStderr Close stderr.
Method closeStdout Close stdout.
Method loseConnection Close the process' stdout, in and err.
Method outConnectionLost Undocumented
Method errConnectionLost Undocumented
Method inConnectionLost Undocumented
Method connectionLostNotify Will be called 3 times, by stdout/err threads and process handle.
Method registerProducer Register to receive data from a producer.
Method unregisterProducer Stop consuming data from a producer, without disconnecting.
Method pauseProducing Undocumented
Method resumeProducing Undocumented
Method stopProducing Stop producing data.
Method __repr__ Return a string representation of the process.

Inherited from _PollingTimer:

Method _addPollableResource Undocumented
Method _checkPollingState Undocumented
Method _startPolling Undocumented
Method _stopPolling Undocumented
Method _pause Undocumented
Method _unpause Undocumented
Method _reschedule Undocumented
Method _pollEvent Undocumented
def __init__(self, reactor, protocol, command, args, environment, path): (source)
Undocumented
def signalProcess(self, signalID): (source)
Send a signal to the process.
ParameterssignalIDcan be
  • one of "HUP", "KILL", "STOP", or "INT". These will be implemented in a cross-platform manner, and so should be used if possible.
  • an integer, where it represents a POSIX signal ID.
Raisestwisted.internet.error.ProcessExitedAlreadyThe process has already exited.
def processEnded(self, status): (source)
This is called when the child terminates.
def write(self, data): (source)
Write data to the process' stdin.
def writeSequence(self, seq): (source)
Write data to the process' stdin.
def closeChildFD(self, fd): (source)
Close a file descriptor which is connected to the child process, identified by its FD in the child process.
def closeStdin(self): (source)
Close the process' stdin.
def closeStderr(self): (source)
Close stderr.
def closeStdout(self): (source)
Close stdout.
def loseConnection(self): (source)
Close the process' stdout, in and err.
def outConnectionLost(self): (source)
Undocumented
def errConnectionLost(self): (source)
Undocumented
def inConnectionLost(self): (source)
Undocumented
def connectionLostNotify(self): (source)
Will be called 3 times, by stdout/err threads and process handle.
def registerProducer(self, producer, streaming): (source)

Register to receive data from a producer.

This sets self to be a consumer for a producer. When this object runs out of data (as when a send(2) call on a socket succeeds in moving the last data from a userspace buffer into a kernelspace buffer), it will ask the producer to resumeProducing().

For IPullProducer providers, resumeProducing will be called once each time data is required.

For IPushProducer providers, pauseProducing will be called whenever the write buffer fills up and resumeProducing will only be called when it empties.
Parametersproducer (type: IProducer provider )
streamingTrue if producer provides IPushProducer, False if producer provides IPullProducer. (type: bool )
ReturnsNone
def unregisterProducer(self): (source)
Stop consuming data from a producer, without disconnecting.
def pauseProducing(self): (source)
Undocumented
def resumeProducing(self): (source)
Undocumented
def stopProducing(self): (source)

Stop producing data.

This tells a producer that its consumer has died, so it must stop producing data for good.
def __repr__(self): (source)
Return a string representation of the process.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 15:57:47.