Beispiel #1
0
def load_from_config(config, prefix):
    settings = config.get_settings()
    settings.setdefault(prefix + 'url', '')
    settings.setdefault(prefix + 'pool_size', 25)
    listname = settings.get(prefix + 'listname', 'cliquet.events')
    client = create_from_config(config, prefix)
    return Listener(client, listname=listname)
Beispiel #2
0
 def setUp(self):
     self.config = testing.setUp()
     self.config.add_settings({
         'events_pool_size': 1,
         'events_url': 'redis://localhost:6379/0'
     })
     self._redis = create_from_config(self.config, prefix='events_')
     self._size = 0
Beispiel #3
0
def load_from_config(config):
    settings = config.get_settings()
    client = create_from_config(config, prefix='cache_')
    return Cache(client, cache_prefix=settings['cache_prefix'])
Beispiel #4
0
 def setUp(self):
     self.config = testing.setUp()
     self.config.add_settings({"events_pool_size": 1, "events_url": "redis://localhost:6379/0"})
     self._redis = create_from_config(self.config, prefix="events_")
     self._size = 0
Beispiel #5
0
def load_from_config(config):
    client = create_from_config(config, prefix='permission_')
    return Permission(client)
Beispiel #6
0
 def setUp(self):
     self.config = testing.setUp()
     self.config.add_settings({'events_pool_size': 1,
                               'events_url': 'redis://localhost:6379/0'})
     self._redis = create_from_config(self.config, prefix='events_')
     self._size = 0
Beispiel #7
0
def load_from_config(config):
    client = create_from_config(config, prefix="cache_")
    return Cache(client)
Beispiel #8
0
def load_from_config(config):
    client = create_from_config(config, prefix='permission_')
    return Permission(client)
Beispiel #9
0
def load_from_config(config):
    settings = config.get_settings()
    client = create_from_config(config, prefix='cache_')
    return Cache(client, cache_prefix=settings['cache_prefix'])