class MemoryProcessTransport(StringTransportWithDisconnection):
Constructor: MemoryProcessTransport(protocol)
Implements interfaces: twisted.internet.interfaces.IProcessTransport
A fake IProcessTransport
provider to be used in tests.
Method | __init__ |
Undocumented |
Method | close |
Close a file descriptor which is connected to the child process, identified by its FD in the child process. |
Method | close |
Close stderr. |
Method | close |
Close stdin after all data has been written out. |
Method | close |
Close stdout. |
Method | pid |
From before IProcessProtocol.makeConnection is called to before IProcessProtocol.processEnded is called, pid is an int giving the platform process ID of this process. pid is None at all other times. |
Method | signal |
Send a signal to the process. |
Method | write |
Similar to ITransport.write but also allows the file descriptor in the child process which will receive the bytes to be specified. |
Instance Variable | closed |
Undocumented |
Instance Variable | protocol |
Undocumented |
Instance Variable | signals |
Undocumented |
Inherited from StringTransportWithDisconnection
:
Method | lose |
Close the connection. Does nothing besides toggle the disconnecting instance variable to True. |
Instance Variable | connected |
Undocumented |
Inherited from StringTransport
(via StringTransportWithDisconnection
):
Method | abort |
Abort the connection. Same as loseConnection, but also toggles the aborted instance variable to True. |
Method | clear |
Discard all data written to this transport so far. |
Method | get |
Similar to getPeer, but returns an address describing this side of the connection. |
Method | get |
Get the remote address of this connection. |
Method | pause |
Pause producing data. |
Method | register |
Register to receive data from a producer. |
Method | resume |
Resume producing data. |
Method | stop |
Stop producing data. |
Method | unregister |
Stop consuming data from a producer, without disconnecting. |
Method | value |
Retrieve all data which has been buffered by this transport. |
Method | write |
Write some data to the physical connection, in sequence, in a non-blocking fashion. |
Method | write |
Write an iterable of byte strings to the physical connection. |
Instance Variable | disconnected |
A bool which is False until abortConnection is called, then True. |
Instance Variable | disconnecting |
A bool which is False until loseConnection is called, then True. |
Instance Variable | host |
None or an object which will be returned as the host address of this transport. If None , a nasty tuple will be returned instead. |
Instance Variable | io |
A io.BytesIO which holds the data which has been written to this transport since the last call to clear . Use value instead of accessing this directly. |
Instance Variable | peer |
None or an object which will be returned as the peer address of this transport. If None , a nasty tuple will be returned instead. |
Instance Variable | producer |
If a producer is currently registered, producer is a reference to it. Otherwise, None . |
Instance Variable | producer |
The state of this StringTransport in its capacity as an IPushProducer . One of 'producing', 'paused', or 'stopped'. |
Instance Variable | streaming |
If a producer is currently registered, streaming refers to the value of the second parameter passed to registerProducer. |
Method | _check |
Undocumented |
Instance Variable | _lenient |
By default StringTransport enforces that resumeProducing is not called after the connection is lost. This is to ensure that any code that does call resumeProducing after the connection is lost is not blindly expecting ... |
Close a file descriptor which is connected to the child process, identified by its FD in the child process.
From before IProcessProtocol.makeConnection
is called to before IProcessProtocol.processEnded
is called, pid is an int
giving the platform process ID of this process. pid is None
at all other times.
Send a signal to the process.
Parameters | |
signal | Undocumented |
signal | can be
|
Raises | |
twisted.internet.error.ProcessExitedAlready | If the process has already exited. |
OSError | If the os.kill call fails with an errno different from ESRCH. |
Similar to ITransport.write
but also allows the file descriptor in the child process which will receive the bytes to be specified.
Parameters | |
child | The file descriptor to which to write. |
data | The bytes to write. |
Raises | |
KeyError | If childFD is not a file descriptor that was mapped in the child when IReactorProcess.spawnProcess was used to create it. |