_Y~ã @s[yddlZWnek r0ddlZYnXddlmZGdd„deƒZdS)éNé)Ú ConnectioncsLeZdZdZ‡fdd†Zdd„Zdd„Zdd „Z‡S) ÚPoolingConnectionzö Base connection class for connections that use libraries without thread safety and no capacity for connection pooling. To use this just implement a ``_make_connection`` method that constructs a new connection and returns it. cs,tjƒ|_tt|ƒj||ŽdS)N)ÚqueueÚQueueÚ_free_connectionsÚsuperrÚ__init__)ÚselfÚargsÚkwargs)Ú __class__©úI/tmp/pip-build-66pc0izb/elasticsearch/elasticsearch/connection/pooling.pyr szPoolingConnection.__init__c Cs7y|jjƒSWntjk r2|jƒSYnXdS)N)rÚ get_nowaitrÚEmptyZ_make_connection)r rrrÚ_get_connectionsz!PoolingConnection._get_connectioncCs|jj|ƒdS)N)rÚput)r ÚconrrrÚ_release_connectionsz%PoolingConnection._release_connectioncCsdS)z- Explicitly close connection Nr)r rrrÚcloseszPoolingConnection.close)Ú__name__Ú __module__Ú __qualname__Ú__doc__r rrrrr)r rrs   r)rÚ ImportErrorrÚbaserrrrrrÚs