def setUp(self):
     pool = BlockingConnectionPool(connection_class=Connection,
                                   max_connections=2,
                                   timeout=5,
                                   host='127.0.0.1',
                                   port=8888)
     self.client = SSDB(connection_pool=pool)
     #self.client = SSDB(host='127.0.0.1', port=8888)
     print('set UP')
Beispiel #2
0
 def __init__(self, name, host, port):
     """
     init
     :param name: hash name
     :param host: ssdb host
     :param port: ssdb port
     :return:
     """
     self.name = name
     self.__conn = SSDB(connection_pool=BlockingConnectionPool(host=host, port=port))
Beispiel #3
0
 def __init__(self, queue_name, host, port, max_connections=10, timeout=60):
     self.queue_name = queue_name
     self.host = host
     self.port = port
     self.max_connections = max_connections
     self.timeout = timeout
     pool = BlockingConnectionPool(connection_class=Connection,
                                   max_connections=max_connections,
                                   timeout=timeout,
                                   host=host,
                                   port=port)
     self.ssdb = SSDB(connection_pool=pool)
 def get_pool(self, connection_info=None, max_connections=10, timeout=20):
     connection_info = connection_info or {
         "host": '127.0.0.1',
         "port": '8888',
     }
     pool = BlockingConnectionPool(connection_class=Connection,
                                   max_connections=max_connections,
                                   timeout=timeout,
                                   **connection_info)
     print('******************************111')
     print(pool)
     print('******************************111')
     return pool
Beispiel #5
0
 def __init__(self, set_name, host, port, max_connections=2, timeout=60):
     """数据库初始化"""
     self.set_name = set_name
     self.host = host
     self.port = port
     self.max_connections = max_connections
     self.timeout = timeout
     pool = BlockingConnectionPool(connection_class=Connection,
                                   max_connections=max_connections,
                                   timeout=timeout,
                                   host=host,
                                   port=port)
     self.ssdb = SSDB(connection_pool=pool)
     pass
Beispiel #6
0
 def __init__(self,
              host="127.0.0.1",
              port=8888,
              max_connections=10,
              timeout=60):
     self.host = host
     self.port = port
     self.max_connections = max_connections
     self.timeout = timeout
     pool = BlockingConnectionPool(connection_class=Connection,
                                   max_connections=max_connections,
                                   timeout=timeout,
                                   host=host,
                                   port=port)
     self.ssdb = SSDB(connection_pool=pool)
Beispiel #7
0
 def __init__(self, host='localhost', port=8888, **kwargs):
     QueueBase.QueueBase.__init__(self, host, port)
     self.__conn = SSDB(connection_pool=BlockingConnectionPool(
         host=self.host, port=self.port))
     self.name = kwargs.get('keyName', 'default')
Beispiel #8
0
 def __init__(self, host, port, table_name, **args):
     self.queue_name = table_name
     pool = BlockingConnectionPool(host=host, port=port, **args)
     self.ssdb = SSDB(connection_pool=pool)
     print 'success init ssdb connection'
 def test_repr_contains_db_info_tcp(self):
     pool = BlockingConnectionPool(host='localhost', port=8888)
     assert_tuple_equal(
         re.match('(.*)<(.*)<(.*)>>', repr(pool)).groups(),
         ('BlockingConnectionPool', 'Connection',
          'host=localhost,port=8888'))
Beispiel #10
0
 def __init__(self, name, host='localhost', port=8888, **kwargs):
     QueueBase.QueueBase.__init__(self, name, host, port)
     self.__conn = SSDB(connection_pool=BlockingConnectionPool(
         host=self.host, port=self.port))