#NEWLINE# def __init__( self , max_size = ( - 1 ) , client_timeout = ( - 1 ) , autoclose = False , **client_kwargs ) : #NEWLINE# #INDENT# 'Constructor.\n\n        Args:\n            max_size (int): max size of the pool (-1 means "no limit").\n            client_timeout (int): timeout in seconds of a connection released\n                to the pool (-1 means "no timeout").\n            autoclose (boolean): automatically disconnect released connections\n                with lifetime > client_timeout (test made every\n                client_timeout/10 seconds).\n            client_kwargs (dict): Client constructor arguments.\n        ' #NEWLINE# self . max_size = max_size #NEWLINE# self . client_timeout = client_timeout #NEWLINE# self . client_kwargs = client_kwargs #NEWLINE# self . __ioloop = client_kwargs . get ( 'ioloop' , tornado . ioloop . IOLoop . instance ( ) ) #NEWLINE# self . autoclose = autoclose #NEWLINE# self . __pool = deque ( ) #NEWLINE# if ( self . max_size != ( - 1 ) ) : #NEWLINE# #INDENT# self . __sem = tornado . locks . Semaphore ( self . max_size ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . __sem = None #NEWLINE# #UNINDENT# self . __autoclose_periodic = None #NEWLINE# if ( self . autoclose and ( self . client_timeout > 0 ) ) : #NEWLINE# #INDENT# every = ( int ( self . client_timeout ) * 100 ) #NEWLINE# self . __autoclose_periodic = tornado . ioloop . PeriodicCallback ( self . _autoclose , every , io_loop = self . __ioloop ) #NEWLINE# self . __autoclose_periodic . start ( )