def _subscribe_to_cmd_pubsub(redis): pubsub = redis.pubsub(ignore_subscribe_messages=True) pubsub.subscribe(get_command_channel_key()) return pubsub
def canel_task(redis, task_id): redis.publish(get_command_channel_key(), 'task:kill:{0}'.format(get_task_hash_key(task_id)))