Did I find the right examples for you? yes no

All Samples(12)  |  Call(10)  |  Derive(0)  |  Import(2)
Thread-safe connection pool.

.. versionadded:: 0.5

The `size` argument specifies how many connections this pool
manages. Additional keyword arguments are passed unmodified to the
:py:class:`happybase.Connection` constructor, with the exception of
the `autoconnect` argument, since maintaining connections is the
task of the pool.
(more...)

src/c/e/ceilometer-HEAD/ceilometer/storage/impl_hbase.py   ceilometer(Download)
        LOG.debug(_('connecting to HBase on %(host)s:%(port)s') % (
                  {'host': conf['host'], 'port': conf['port']}))
        return happybase.ConnectionPool(size=100, host=conf['host'],
                                        port=conf['port'],
                                        table_prefix=conf['table_prefix'])

src/s/o/socorro-HEAD/socorro/external/happybase/connection_context.py   socorro(Download)
    def __init__(self, config):
        super(HappyBasePooledConnectionContext, self).__init__(config)
        self._connection_pool = happybase.ConnectionPool(
            20,  # TODO: how to get this number imported from the taskmanager
            host=self.config.hbase_host,

src/h/a/happybase-0.8/tests/test_api.py   happybase(Download)
)
 
from happybase import Connection, ConnectionPool, NoConnectionsAvailable
 
HAPPYBASE_HOST = os.environ.get('HAPPYBASE_HOST')
def test_connection_pool_construction():
    with assert_raises(TypeError):
        ConnectionPool(size='abc')
 
    with assert_raises(ValueError):
        ConnectionPool(size=0)
    N_THREADS = 10
 
    pool = ConnectionPool(size=3, **connection_kwargs)
    threads = [threading.Thread(target=run) for i in xrange(N_THREADS)]
 
def test_pool_exhaustion():
    pool = ConnectionPool(size=1, **connection_kwargs)
 
    def run():
        with assert_raises(NoConnectionsAvailable):

src/h/a/happybase-HEAD/tests/test_api.py   happybase(Download)
)
 
from happybase import Connection, ConnectionPool, NoConnectionsAvailable
 
HAPPYBASE_HOST = os.environ.get('HAPPYBASE_HOST')
def test_connection_pool_construction():
    with assert_raises(TypeError):
        ConnectionPool(size='abc')
 
    with assert_raises(ValueError):
        ConnectionPool(size=0)
    N_THREADS = 10
 
    pool = ConnectionPool(size=3, **connection_kwargs)
    threads = [threading.Thread(target=run) for i in xrange(N_THREADS)]
 
def test_pool_exhaustion():
    pool = ConnectionPool(size=1, **connection_kwargs)
 
    def run():
        with assert_raises(NoConnectionsAvailable):