| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python2.7/dist-packages/twisted/internet/ |
Upload File : |
˪Nc @ s d Z d d l m Z d d l m Z m Z d d l m Z m Z d e f d YZ
d e f d YZ d e
e f d
YZ d Z
d g Z d S(
s+
Support for generic select()able objects.
i( t
implements( t reflectt failure( t
interfacest maint _ConsumerMixinc B s; e Z d Z d Z e Z e Z d Z d Z d Z
RS( s
L{IConsumer} implementations can mix this in to get C{registerProducer} and
C{unregisterProducer} methods which take care of keeping track of a
producer's state.
Subclasses must provide three attributes which L{_ConsumerMixin} will read
but not write:
- connected: A C{bool} which is C{True} as long as the the consumer has
someplace to send bytes (for example, a TCP connection), and then
C{False} when it no longer does.
- disconnecting: A C{bool} which is C{False} until something like
L{ITransport.loseConnection} is called, indicating that the send buffer
should be flushed and the connection lost afterwards. Afterwards,
C{True}.
- disconnected: A C{bool} which is C{False} until the consumer no longer
has a place to send bytes, then C{True}.
Subclasses must also override the C{startWriting} method.
@ivar producer: C{None} if no producer is registered, otherwise the
registered producer.
@ivar producerPaused: A flag indicating whether the producer is currently
paused.
@type producerPaused: C{bool} or C{int}
@ivar streamingProducer: A flag indicating whether the producer was
registered as a streaming (ie push) producer or not (ie a pull
producer). This will determine whether the consumer may ever need to
pause and resume it, or if it can merely call C{resumeProducing} on it
when buffer space is available.
@ivar streamingProducer: C{bool} or C{int}
c C s t d d S( s
Override in a subclass to cause the reactor to monitor this selectable
for write events. This will be called once in C{unregisterProducer} if
C{loseConnection} has previously been called, so that the connection can
actually close.
s! %r did not implement startWritingN( t NotImplementedError( t self( ( s= /usr/lib/python2.7/dist-packages/twisted/internet/abstract.pyt startWriting; s c C sj | j d k r+ t d | | j f n | j rA | j n% | | _ | | _ | sf | j n d S( s"
Register to receive data from a producer.
This sets this selectable to be a consumer for a producer. When this
selectable runs out of data on a write() call, it will ask the producer
to resumeProducing(). When the FileDescriptor's internal data buffer is
filled, it will ask the producer to pauseProducing(). If the connection
is lost, FileDescriptor calls producer's stopProducing() method.
If streaming is true, the producer should provide the IPushProducer
interface. Otherwise, it is assumed that producer provides the
IPullProducer interface. In this case, the producer won't be asked to
pauseProducing(), but it has to be careful to write() data only when its
resumeProducing() method is called.
sH Cannot register producer %s, because producer %s was never unregistered.N( t producert Nonet RuntimeErrort disconnectedt
stopProducingt streamingProducert resumeProducing( R R t streaming( ( s= /usr/lib/python2.7/dist-packages/twisted/internet/abstract.pyt registerProducerE s
c C s, d | _ | j r( | j r( | j n d S( sM
Stop consuming data from a producer, without disconnecting.
N( R
R t connectedt
disconnectingR ( R ( ( s= /usr/lib/python2.7/dist-packages/twisted/internet/abstract.pyt unregisterProducerb s N( t __name__t
__module__t __doc__R
R t Falset producerPausedR R R R ( ( ( s= /usr/lib/python2.7/dist-packages/twisted/internet/abstract.pyR s %
t _LogOwnerc B s- e Z d Z e e j d Z d Z RS( s
Mixin to help implement L{interfaces.ILoggingContext} for transports which
have a protocol, the log prefix of which should also appear in the
transport's log prefix.
c C s&