Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib64/python3.7/site-packages/twisted/conch/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/twisted/conch/__pycache__/mixin.cpython-37.pyc

B

:��]^�@s"dZddlmZGdd�d�ZdS)z�
Experimental optimization

This module provides a single mixin class which allows protocols to
collapse numerous small writes into a single larger one.

@author: Jp Calderone
�)�reactorc@s<eZdZdZdZdZdZdd�Zdd�Zdd	�Z	d
d�Z
dS)�BufferingMixinz+
    Mixin which adds write buffering.
    NgcCst�|j|j�S)N)rZ	callLater�DELAY�flush)�self�r�F/opt/alt/python37/lib64/python3.7/site-packages/twisted/conch/mixin.py�scheduleszBufferingMixin.schedulecCs|�|j�dS)N)�resetr)r�tokenrrr�
rescheduleszBufferingMixin.reschedulecCs8|jdkrg|_|��|_n|�|j�|j�|�dS)a
        Buffer some bytes to be written soon.

        Every call to this function delays the real write by C{self.DELAY}
        seconds.  When the delay expires, all collected bytes are written
        to the underlying transport using L{ITransport.writeSequence}.
        N)�_delayedWriteCall�datar	r�append)rrrrr�write!s

zBufferingMixin.writecCsd|_|j�|j�d|_dS)z/
        Flush the buffer immediately.
        N)r
Z	transportZ
writeSequencer)rrrrr1szBufferingMixin.flush)�__name__�
__module__�__qualname__�__doc__r
rrr	rrrrrrrrsrN)rZtwisted.internetrrrrrr�<module>s