def __init__(self, client, pair, *args, **kwargs): # MockPool gets a 'client' arg, regular pools don't. Weakref it to # avoid cycle with __del__, causing ResourceWarnings in Python 3.3. self.client = weakref.proxy(client) self.mock_host, self.mock_port = pair # Actually connect to the default server. Pool.__init__(self, (default_host, default_port), *args, **kwargs)
def __init__(self, client, pair, *args, **kwargs): # MockPool gets a 'client' arg, regular pools don't. Weakref it to # avoid cycle with __del__, causing ResourceWarnings in Python 3.3. self.client = weakref.proxy(client) self.mock_host, self.mock_port = pair # Actually connect to the default server. Pool.__init__(self, (client_context.host, client_context.port), *args, **kwargs)
def __init__(self, client, pair, *args, **kwargs): # MockPool gets a 'client' arg, regular pools don't. self.client = client self.mock_host, self.mock_port = pair # Actually connect to the default server. Pool.__init__(self, pair=(default_host, default_port), max_size=None, net_timeout=None, conn_timeout=20, use_ssl=False, use_greenlets=False)
def __init__(self, client, pair, *args, **kwargs): # MockPool gets a 'client' arg, regular pools don't. self.client = client self.mock_host, self.mock_port = pair # Actually connect to the default server. Pool.__init__( self, pair=(default_host, default_port), max_size=None, net_timeout=None, conn_timeout=20, use_ssl=False, use_greenlets=False)
def __init__(self, pair, *args, **kwargs): if pair: # RS client passes 'pair' to Pool's constructor. self.mock_host, self.mock_port = pair else: # MongoClient passes pair to get_socket() instead. self.mock_host, self.mock_port = None, None Pool.__init__( self, pair=(default_host, default_port), max_size=None, net_timeout=None, conn_timeout=20, use_ssl=False, use_greenlets=False)