AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/twisted/internet/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/twisted/internet/__pycache__/_producer_helpers.cpython-310.pyc
o

�bE�@sxUdZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZgZ
eeed<ee�Gd	d
�d
��ZdS)z%
Helpers for working with producers.
�)�List)�implementer)�
IPushProducer)�	cooperate)�log)�safe_str�__all__c@sLeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)�_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.
    FcCs||_||_dS)N)�	_producer�	_consumer)�self�pullProducer�consumer�r�D/usr/lib/python3/dist-packages/twisted/internet/_producer_helpers.py�__init__2s
z_PullToPush.__init__ccs��	z|j��Wn7ty@t�ddt|j�f�z|j��Wnty=t�ddt|j�f�d|_YYdSwYnwdVq)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.
        TNz%%s failed, producing will be stopped:z!%s failed to unregister producer:)	r
�resumeProducing�
BaseExceptionr�errrr�unregisterProducer�	_finished�rrrr�_pull6s6�
��
������z_PullToPush._pullcCst|���|_dS)z�
        This should be called by the consumer when the producer is registered.

        Start streaming data to the consumer.
        N)rr�	_coopTaskrrrr�startStreamingWsz_PullToPush.startStreamingcCs|jrdSd|_|j��dS)z�
        This should be called by the consumer when the producer is
        unregistered.

        Stop streaming data to the consumer.
        NT)rr�stoprrrr�
stopStreaming_sz_PullToPush.stopStreamingcC�|j��dS)z7
        @see: C{IPushProducer.pauseProducing}
        N)r�pauserrrr�pauseProducingk�z_PullToPush.pauseProducingcCr)z8
        @see: C{IPushProducer.resumeProducing}
        N)r�resumerrrrrqr z_PullToPush.resumeProducingcCs|��|j��dS)z6
        @see: C{IPushProducer.stopProducing}
        N)rr
�
stopProducingrrrrr"wsz_PullToPush.stopProducingN)�__name__�
__module__�__qualname__�__doc__rrrrrrrr"rrrrr	s!r	N)r&�typingr�zope.interfacer�twisted.internet.interfacesr�twisted.internet.taskr�twisted.pythonr�twisted.python.reflectrr�str�__annotations__r	rrrr�<module>s

Anon7 - 2022
AnonSec Team