def __init__(self, **kw): config = merge(defaults, settings.like("amqp"), kw) required = ("port", "username", "password", "host", "vhost", "exchange", "queue") require(self, config, required) self.__dict__.update(config) self.config = config self.reconnect()
def __init__(self, **kwargs): config = merge(defaults, settings.like('cassandra'), kwargs) require(self, config, ('cf_content', 'keyspace', 'servers', 'port')) self.__dict__.update(config) self.pool_size = len(self.servers) * 2 self.pool = pycassa.ConnectionPool( self.keyspace, self.servers, timeout=self.timeout, max_retries=self.max_retries, pool_timeout=self.pool_timeout, pool_size=self.pool_size, recycle=self.recycle, prefill=self.prefill, ) self.client = pycassa.ColumnFamily(self.pool, self.cf_content)
def __init__(self, **kw): config = merge(defaults, settings.like("mysql"), kw) require(self, config, ("host", "password", "username", "database")) self.config = config self.pool = MysqlConnectionPool(config)
def __init__(self, **kw): config = merge(defaults, settings.like("memcached"), kw) require(self, config, ("host", "port")) self.config = config self.pool = {}