Home | Trees | Index | Help |
---|
Package twisted :: Package internet :: Module process :: Class Process |
|
Logger
--+ |Ephemeral
--+ |FileDescriptor
--+ |Ephemeral
--+ | Process
An operating-system Process.
This represents an operating-system process with standard input, standard output, and standard error streams connected to it.
On UNIX, this is implemented using fork(), exec(), pipe() and fcntl(). These calls may not exist elsewhere so this code is not cross-platform. (also, windows can only select on sockets...)Method Summary | |
---|---|
Spawn an operating-system process. | |
__getstate__(self)
(inherited from Ephemeral )
| |
__setstate__(self,
state)
(inherited from Ephemeral )
| |
Close stderr. | |
Call this to close standard input on this process. | |
Close stdout. | |
stdout closed. | |
Called when my standard error stream is ready for reading. | |
Called when my standard output stream is ready for reading. | |
Called when my standard output stream is ready for writing. | |
errConnectionLost(self)
| |
This returns the file number of standard output on this process. | |
inConnectionLost(self)
| |
log(self,
bytes)
(inherited from Logger )
| |
Override this method to insert custom logging behavior. (inherited from Logger )
| |
Close the connection at the next available opportunity. | |
maybeCallProcessEnded(self)
| |
pauseProducing(self)
(inherited from FileDescriptor )
| |
processEnded(self,
status)
| |
Try to reap a process (without blocking) via waitpid. | |
Register to receive data from a producer. (inherited from FileDescriptor )
| |
resumeProducing(self)
(inherited from FileDescriptor )
| |
signalProcess(self,
signalID)
| |
Start waiting for read availability. (inherited from FileDescriptor )
| |
Start waiting for write availability. (inherited from FileDescriptor )
| |
Stop consuming data. (inherited from FileDescriptor )
| |
stopProducing(self)
(inherited from FileDescriptor )
| |
Stop waiting for read availability. (inherited from FileDescriptor )
| |
Stop waiting for write availability. (inherited from FileDescriptor )
| |
Stop consuming data from a producer, without disconnecting. (inherited from FileDescriptor )
| |
Call this to write to standard input on this process. | |
writeSequence(self,
iovec)
(inherited from FileDescriptor )
| |
Write as much as possible of the given data, immediately. (inherited from FileDescriptor )
|
Class Variable Summary | |
---|---|
int |
lostErrorConnection
|
int |
lostInConnection
|
int |
lostOutConnection
|
int |
lostProcess
|
Method Details |
---|
__init__(self,
reactor,
command,
args,
environment,
path,
proto,
uid=None,
gid=None)
|
closeStderr(self)Close stderr. |
closeStdin(self)Call this to close standard input on this process. |
closeStdout(self)Close stdout. |
connectionLost(self, reason)stdout closed. |
doError(self)Called when my standard error stream is ready for reading. |
doRead(self)Called when my standard output stream is ready for reading. |
doWrite(self)Called when my standard output stream is ready for writing. This will only happen in the case where the pipe to write to is broken. |
fileno(self)This returns the file number of standard output on this process. |
loseConnection(self)Close the connection at the next available opportunity. Call this to cause this FileDescriptor to lose its connection; if this is in the main loop, it will lose its connection as soon as it's done flushing its write buffer; otherwise, it will wake up the main thread and lose the connection immediately. If you have a producer registered, the connection won't be closed until the producer is finished. Therefore, make sure you unregister your producer when it's finished, or the connection will never close.
|
reapProcess(self)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.) |
write(self, data)Call this to write to standard input on this process. |
Class Variable Details |
---|
lostErrorConnection
|
lostInConnection
|
lostOutConnection
|
lostProcess
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 1.1 on Sat Feb 15 21:17:52 2003 | http://epydoc.sf.net |