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__/abc.cpython-35.opt-1.pyc



�D�Z�@s�dZddlZddlZddlmZdddgZGdd�de�ZGdd�de�ZGd	d�de�ZdS)
z�The module provides connection and connections pool interfaces.

These are intended to be used for implementing custom connection managers.
�N)�ABC�
AbcConnection�AbcPool�
AbcChannelc@s0eZdZdZejdd��Zejdd��Zejdd��Ze	j
ejdd	���Zeejd
d���Z
eejdd
���Zeejdd���Zeejdd���Zeejdd���Zeejdd���Zeejdd���ZdS)rzAbstract connection interface.cOsdS)zExecute redis command.N�)�self�command�args�kwargsrr�=/opt/alt/python35/lib/python3.5/site-packages/aioredis/abc.py�executeszAbcConnection.executecOsdS)z3Execute Redis (p)subscribe/(p)unsubscribe commands.Nr)rrr	r
rrr�execute_pubsubszAbcConnection.execute_pubsubcCsdS)z2Perform connection(s) close and resources cleanup.Nr)rrrr�closeszAbcConnection.closecCsdS)zW
        Coroutine waiting until all resources are closed/released/cleaned up.
        Nr)rrrr�wait_closed!szAbcConnection.wait_closedcCsdS)z;Flag indicating if connection is closing or already closed.Nr)rrrr�closed(szAbcConnection.closedcCsdS)zCurrent selected DB index.Nr)rrrr�db-szAbcConnection.dbcCsdS)zCurrent set connection codec.Nr)rrrr�encoding2szAbcConnection.encodingcCsdS)zmReturns number of subscribed channels.

        Can be tested as bool indicating Pub/Sub mode state.
        Nr)rrrr�	in_pubsub7szAbcConnection.in_pubsubcCsdS)zRead-only channels dict.Nr)rrrr�pubsub_channels?szAbcConnection.pubsub_channelscCsdS)zRead-only patterns dict.Nr)rrrr�pubsub_patternsDszAbcConnection.pubsub_patternscCsdS)zConnection address.Nr)rrrr�addressIszAbcConnection.addressN)�__name__�
__module__�__qualname__�__doc__�abc�abstractmethodrr
r�asyncio�	coroutiner�propertyrrrrrrrrrrrrs(c@syeZdZdZejdd��Zejejdd���Z	ejdd��Z
eejdd	���Zd
S)rz�Abstract connections pool interface.

    Inherited from AbcConnection so both have common interface
    for executing Redis commands.
    cCsdS)uu
        Gets free connection from pool in a sync way.

        If no connection available — returns None.
        Nr)rrrr�get_connectionVszAbcPool.get_connectioncCsdS)zAcquires connection from pool.Nr)rrrr�acquire^szAbcPool.acquirecCsdS)zjReleases connection to pool.

        :param AbcConnection conn: Owned connection to be released.
        Nr)rZconnrrr�releasecszAbcPool.releasecCsdS)zConnection address or None.Nr)rrrrrjszAbcPool.addressN)
rrrrrrr rrr!r"rrrrrrrOsc@s�eZdZdZeejdd���Zeejdd���Zeejdd���Z	e
jejdd	���Zejd
d��Z
ejdd
d��ZdS)rz#Abstract Pub/Sub Channel interface.cCsdS)z Encoded channel name or pattern.Nr)rrrr�namesszAbcChannel.namecCsdS)z6Boolean flag indicating if channel is pattern channel.Nr)rrrr�
is_patternxszAbcChannel.is_patterncCsdS)zVFlag indicating that channel has unreceived messages
        and not marked as closed.Nr)rrrr�	is_active}szAbcChannel.is_activecCsdS)zjWait and return new message.

        Will raise ``ChannelClosedError`` if channel is not active.
        Nr)rrrr�get�szAbcChannel.getcCsdS)z�Send data to channel.

        Called by RedisConnection when new message received.
        For pattern subscriptions data will be a tuple of
        channel name and message itself.
        Nr)r�datarrr�
put_nowait�szAbcChannel.put_nowaitNcCsdS)z�Marks Channel as closed, no more messages will be sent to it.

        Called by RedisConnection when channel is unsubscribed
        or connection is closed.
        Nr)r�excrrrr�szAbcChannel.close)rrrrrrrr#r$r%rrr&r(rrrrrrps	)rrrr�__all__rrrrrrr�<module>s	=!