def __init__(self, app=None, pool_cls=None, pool_concurrency=None): self.pool = instantiate(pool_cls or self.pool_cls, limit=pool_concurrency or self.pool_concurrency) self.app = app_or_default(app) self.consumer = Consumer(callback=self.dispatch_tasks, app=self.app)
def __init__(self, callback=None, app=None): self.app = app_or_default(app) self.callback = callback super(Consumer, self).__init__()