3 ²˜‚]~ã @sJy ddlZWnek r(ddlZYnXddlmZGdd„deƒZdS)éNé)Ú Connectioncs8eZdZdZ‡fdd„Zdd„Zdd„Zdd „Z‡ZS) Ú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-z81i1n8o/elasticsearch/elasticsearch/connection/pooling.pyr s zPoolingConnection.__init__c Cs*y |jjƒStjk r$|jƒSXdS)N)rÚ get_nowaitrÚEmptyZ_make_connection)r rrrÚ_get_connections z!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 rrrÚ __classcell__rr)r rrs  r)rÚ ImportErrorrÚbaserrrrrrÚs