Your IP : 3.135.241.191


Current Path : /opt/alt/python37/lib/python3.7/site-packages/raven/transport/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/raven/transport/__pycache__/gevent.cpython-37.pyc

B

��Yz�@s�dZddlmZddlmZddlmZyBddlZyddlm	Z	Wn e
k
rbddlm	Z	YnXdZWne
k
r�dZYnXGdd	�d	ee�Z
dS)
z�
raven.transport.gevent
~~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
�)�absolute_import)�AsyncTransport)�
HTTPTransportN)�	SemaphoreTcs:eZdZddgZd
�fdd�	Z�fdd�Zdd	�Z�ZS)�GeventedHTTPTransportzgevent+httpzgevent+https�dcs,tstd��t|�|_tt|�j||�dS)Nz&GeventedHTTPTransport requires gevent.)�
has_gevent�ImportErrorr�_lock�superr�__init__)�selfZmaximum_outstanding_requests�args�kwargs)�	__class__��G/opt/alt/python37/lib/python3.7/site-packages/raven/transport/gevent.pyrs
zGeventedHTTPTransport.__init__cs4�j��t�tt��j|||�����fdd��S)z?
        Spawn an async request to a remote webserver.
        cs��|���S)N)�_done)�x)�
failure_cbr
�
success_cbrr�<lambda>.�z2GeventedHTTPTransport.async_send.<locals>.<lambda>)r
�acquire�gevent�spawnrr�send�link)r
�url�data�headersrr)r)rr
rr�
async_send%s
z GeventedHTTPTransport.async_sendcGs(|j��|��r|�n
||j�dS)N)r
�releaseZ
successful�	exception)r
Zgreenletrrrrrrr0s
zGeventedHTTPTransport._done)r)�__name__�
__module__�__qualname__�schemerr!r�
__classcell__rr)rrrsr)�__doc__�
__future__rZraven.transport.baserZraven.transport.httprrZgevent.lockrr	Zgevent.corosrrrrrr�<module>s


?>