twisted :: internet :: process :: ProcessReader :: Class ProcessReader
[frames] | no frames]

Class ProcessReader

             object --+        
                      |        
abstract._ConsumerMixin --+    
                          |    
             object --+   |    
                      |   |    
     abstract._LogOwner --+    
                          |    
    abstract.FileDescriptor --+
                              |
                             ProcessReader

ProcessReader

I am a selectable representation of a process's output pipe, such as stdout and stderr.

Instance Methods
 
__init__(self, reactor, proc, name, fileno)
Initialize, specifying a process to connect to.
 
fileno(self)
Return the fileno() of my process's stderr.
 
writeSomeData(self, data)
Write as much as possible of the given data, immediately.
 
doRead(self)
This is called when the pipe becomes readable.
 
dataReceived(self, data)
 
loseConnection(self)
Close the connection at the next available opportunity.
 
connectionLost(self, reason)
Close my end of the pipe, signal the Process (which signals the ProcessProtocol).

Inherited from abstract.FileDescriptor: __provides__, doWrite, loseWriteConnection, pauseProducing, readConnectionLost, resumeProducing, startReading, startWriting, stopConsuming, stopProducing, stopReading, stopWriting, write, writeConnectionLost, writeSequence

Inherited from abstract._ConsumerMixin: __providedBy__, registerProducer, unregisterProducer

Inherited from abstract._LogOwner: logPrefix

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  connected = 1

Inherited from abstract.FileDescriptor: SEND_LIMIT, __implemented__, bufferSize, dataBuffer, disconnected, disconnecting, offset, producer

Instance Variables

Inherited from abstract._ConsumerMixin: producerPaused, streamingProducer

Properties

Inherited from object: __class__

Method Details

__init__(self, reactor, proc, name, fileno)
(Constructor)

 

Initialize, specifying a process to connect to.

Overrides: object.__init__

fileno(self)

 

Return the fileno() of my process's stderr.

Overrides: abstract.FileDescriptor.fileno

writeSomeData(self, data)

 

Write as much as possible of the given data, immediately.

This is called to invoke the lower-level writing functionality, such as a socket's send() method, or a file's write(); this method returns an integer or an exception. If an integer, it is the number of bytes written (possibly zero); if an exception, it indicates the connection was lost.

Overrides: abstract.FileDescriptor.writeSomeData
(inherited documentation)

doRead(self)

 

This is called when the pipe becomes readable.

Overrides: abstract.FileDescriptor.doRead

loseConnection(self)

 

Close the connection at the next available opportunity.

Call this to cause this FileDescriptor to lose its connection. It will first write any data that it has buffered.

If there is data buffered yet to be written, this method will cause the transport to lose its connection as soon as it's done flushing its write buffer. 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.

Overrides: abstract.FileDescriptor.loseConnection
(inherited documentation)

connectionLost(self, reason)

 

Close my end of the pipe, signal the Process (which signals the ProcessProtocol).

Overrides: abstract.FileDescriptor.connectionLost