celery.contrib.migrate

    exception celery.contrib.migrate.StopFiltering

    class celery.contrib.migrate.State[源代码]

    • count = 0

    • filtered = 0

    • strtotal None

    celery.contrib.migrate.republish(producer, message, exchange=None, routing_key=None, remove_props=[u’application_headers’, u’content_type’, u’content_encoding’, u’headers’])[源代码]

    celery.contrib.migrate.migrate_task(producer, body_, message, queues=None)

    celery.contrib.migrate.move(predicate, connection=None, exchange=None, routing_key=None, source=None, app=None, callback=None, limit=None, transform=None, \*kwargs*)[源代码]

    Find tasks by filtering them and move the tasks to a new queue.

    Also supports the same keyword arguments as .

    To demonstrate, the move_task_by_id() operation can be implemented like this:

    or with a transform:

    The predicate may also return a tuple of (exchange, routing_key) to specify the destination to where the task should be moved, or a Queue instance. Any other true value means that the task will be moved to the default exchange/routing_key.

    celery.contrib.migrate.task_id_eq(task_id, body, message)

    celery.contrib.migrate.start_filter(app, conn, filter, limit=None, timeout=1.0, ack_messages=False, tasks=None, queues=None, callback=None, forever=False, on_declare_queue=None, consume_from=None, state=None, accept=None, \*kwargs*)[源代码]

    celery.contrib.migrate.move_task_by_id(task_id, dest, \*kwargs*)

    Find a task by id and move it to another queue.

    参数:
    • dest – Destination queue.

    Also supports the same keyword arguments as move().

    celery.contrib.migrate.move_by_idmap(map, \*kwargs*)

    Moves tasks by matching from a task_id: queue mapping, where queue is a queue to move the task to.

    Example:

    celery.contrib.migrate.move_by_taskmap(map, \*kwargs*)[源代码]

    Example: