HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/conch/__pycache__/mixin.cpython-310.pyc
o

�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)r�	callLater�DELAY�flush��self�r
�5/usr/lib/python3/dist-packages/twisted/conch/mixin.py�schedule�zBufferingMixin.schedulecCs|�|j�dSr)�resetr)r	�tokenr
r
r�
rescheduler
zBufferingMixin.reschedulecCs8|jdurg|_|��|_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)r	rr
r
r�write!s

zBufferingMixin.writecCsd|_|j�|j�d|_dS)z/
        Flush the buffer immediately.
        N)r�	transport�
writeSequencerrr
r
rr0s
zBufferingMixin.flush)�__name__�
__module__�__qualname__�__doc__rrrrrrrr
r
r
rrsrN)r�twisted.internetrrr
r
r
r�<module>s