Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib/python3.5/site-packages/aioredis/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib/python3.5/site-packages/aioredis/__pycache__/stream.cpython-35.opt-1.pyc



�D�Z��@snddlZdddgZdddddddd�Zdddddd�ZGd	d�dej�ZdS)
�N�open_connection�open_unix_connection�StreamReader�loop�parserc
�s�|dkrtj�}td|d|�}tj|d|��|j�fdd�|||�IdH\}}tj|�||�}	||	fS)N�limitrcs�S)N�r)�protocolr�@/opt/alt/python35/lib/python3.5/site-packages/aioredis/stream.py�<lambda>sz!open_connection.<locals>.<lambda>)�asyncio�get_event_loopr�StreamReaderProtocolZcreate_connection�StreamWriter)
�hostZportrrr�kwds�reader�	transport�_�writerr)r	r
r
s)c	�s�|dkrtj�}td|d|�}tj|d|��|j�fdd�||�IdH\}}tj|�||�}||fS)Nrrcs�S)Nrr)r	rr
r!sz&open_unix_connection.<locals>.<lambda>)rr
rrZcreate_unix_connectionr)	Zaddressrrrrrrrrr)r	r
rs&c@sdeZdZdZdZdd�Zdd�Zdd�Zd	d
�ZeZ	eZ
eZeZdS)ra

    Override the official StreamReader to address the
    following issue: http://bugs.python.org/issue30861

    Also it leverages to get rid of the dobule buffer and
    get rid of one coroutine step. Data flows from the buffer
    to the Redis parser directly.
    NcCs9||_|jr5|jj|j�|jdd�=dS)N)�_parser�_buffer�feed)�selfrrrr
�
set_parser1s		zStreamReader.set_parsercCsK|s
dS|jdkr-|jj|�dS|jj|�|j�dS)N)rr�extendrZ_wakeup_waiter)r�datarrr
�	feed_data7szStreamReader.feed_datac�sXxQ|jj�}|dk	r"|S|jr4|j�|jr>P|jd�IdHqWdS)ze
        Return a parsed Redis object or an exception
        when something wrong happened.
        F�readobjN)rZgetsZ
_exceptionZ_eofZ_wait_for_data)r�objrrr
rGs			zStreamReader.readobjc�std��dS)NzUse readobj)�RuntimeError)r�args�kwargsrrr
�_read_not_allowedaszStreamReader._read_not_allowed)
�__name__�
__module__�__qualname__�__doc__rrrrr#�read�readlineZ	readuntilZreadexactlyrrrr
r&s)r�__all__rrrrrrr
�<module>s