+
    üÐjb  ã                   ó–   a € R t0 t R t^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ]! 4       t. t] ^ k ]! ]4       ! R R4      4       tR	# )
z%
Helpers for working with producers.
)ÚList)Úimplementer)ÚIPushProducer)Ú	cooperate)ÚLoggerc                   óR   a € ] tR t^t o RtRtR tR tR tR t	R t
R tR	 tR
tV tR# )Ú_PullToPusha™  
An adapter that converts a non-streaming to a streaming producer.

Because of limitations of the producer API, this adapter requires the
cooperation of the consumer. When the consumer's C{registerProducer} is
called with a non-streaming producer, it must wrap it with L{_PullToPush}
and then call C{startStreaming} on the resulting object. When the
consumer's C{unregisterProducer} is called, it must call
C{stopStreaming} on the L{_PullToPush} instance.

If the underlying producer throws an exception from C{resumeProducing},
the producer will be unregistered from the consumer.

@ivar _producer: the underling non-streaming producer.

@ivar _consumer: the consumer with which the underlying producer was
                 registered.

@ivar _finished: C{bool} indicating whether the producer has finished.

@ivar _coopTask: the result of calling L{cooperate}, the task driving the
                 streaming producer.
Fc                ó   € Wn         W n        R # )N)Ú	_producerÚ	_consumer)ÚselfÚpullProducerÚconsumers   &&&ÚD/usr/lib/python3/dist-packages/twisted/internet/_producer_helpers.pyÚ__init__Ú_PullToPush.__init__3   s   € Ø%ŒØ!Žó    c              #  óî  "  €  \         P                  RV P                  R7      ;_uu_ 4       pV P                  P                  4        RRR4       XP                  '       dh   \         P                  RV P
                  R7      ;_uu_ 4       pV P
                  P                  4        RRR4       XP                  '       d
   RV n        R# Rx € KÌ    + '       g   i     L�; i  + '       g   i     LD; i5i)zÄ
A generator that calls C{resumeProducing} on the underlying producer
forever.

If C{resumeProducing} throws an exception, the producer is
unregistered, which should result in streaming stopping.
Tz+while calling resumeProducing on {producer})ÚproducerNz.while calling unregisterProducer on {consumer})r   )Ú_logÚfailuresHandledr
   ÚresumeProducingÚfailedr   ÚunregisterProducerÚ	_finished)r   ÚopÚ
handlingops   &  r   Ú_pullÚ_PullToPush._pull7   s¾   é € ð Ü×%Ñ%Ø=ÈÏÉð &÷ ô àØ—‘×.Ñ.Ô0÷ð �y�yˆyÜ×)Ñ)ØDØ!Ÿ^™^ð *÷ ô ð  Ø—N‘N×5Ñ5Ô7÷	ð
 ×$×$Ð$ð &*�D”NÙØŒJ÷÷ ú÷
÷ üs@   ‚+C5­CÁC5Á")C5ÂC"Â&C5Ã C5ÃC	ÃC5Ã"C2	Ã-C5c                óB   € \        V P                  4       4      V n        R# )zo
This should be called by the consumer when the producer is registered.

Start streaming data to the consumer.
N)r   r   Ú	_coopTask©r   s   &r   ÚstartStreamingÚ_PullToPush.startStreamingQ   s   € ô # 4§:¡:£<Ó0ˆŽr   c                óp   € V P                   '       d   R# RV n         V P                  P                  4        R# )zp
This should be called by the consumer when the producer is
unregistered.

Stop streaming data to the consumer.
NT)r   r    Ústopr!   s   &r   ÚstopStreamingÚ_PullToPush.stopStreamingY   s'   € ð �>�>ˆ>ÙØˆŒØ�‰×ÑÖr   c                ó:   € V P                   P                  4        R# )z'
@see: C{IPushProducer.pauseProducing}
N)r    Úpauser!   s   &r   ÚpauseProducingÚ_PullToPush.pauseProducinge   s   € ð 	�‰×ÑÖr   c                ó:   € V P                   P                  4        R# )z(
@see: C{IPushProducer.resumeProducing}
N)r    Úresumer!   s   &r   r   Ú_PullToPush.resumeProducingk   s   € ð 	�‰×ÑÖr   c                óZ   € V P                  4        V P                  P                  4        R# )z&
@see: C{IPushProducer.stopProducing}
N)r&   r
   ÚstopProducingr!   s   &r   r0   Ú_PullToPush.stopProducingq   s    € ð 	×ÑÔØ�‰×$Ñ$Ö&r   )r   r    r   r
   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r"   r&   r*   r   r0   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r      s9   ø‡ € ñð0 €Iò"òò41ò
òò ÷'ð 'r   r   c                óV   € V ^8„  d   Qh/ ^ \         9   d   \        \        ,          ;R&   # )é   Ú__all__)Ú__conditional_annotations__r   Ústr)Úformats   "r   Ú__annotate__r@      s"   € ÷ ñ ÷ Ò ŒŒc�Ñ òr   N)r=   r6   Útypingr   Úzope.interfacer   Útwisted.internet.interfacesr   Útwisted.internet.taskr   Útwisted.loggerr   r   r<   r   r@   )r=   s   @r   Ú<module>rF      sN   øðö
õ å &å 5Ý +Ý !áƒx€ð €Ó ñ ˆ]Ó÷^'ð ^'ó ò^'r   