move
Find tasks by filtering them and move the tasks to a new queue.
def move(
predicate: Callable,
connection: kombu.Connection = None,
exchange: Union[str, kombu.Exchange] = None,
routing_key: str = None,
source: List[Union[str, kombu.Queue]] = None,
app: Celery = None,
callback: Callable = None,
limit: int = None,
transform: Callable = None,
**kwargs: dict
) - > Any
Find tasks by filtering them and move the tasks to a new queue.
Parameters
| Name | Type | Description |
|---|---|---|
| predicate | Callable | Filter function used to decide the messages to move; must accept (body, message) and return a destination (Queue, tuple, or boolean). |
| connection | kombu.Connection = None | Custom Kombu connection instance to use for the migration operation instead of acquiring one from the pool. |
| exchange | Union[str, kombu.Exchange] = None | The default destination exchange name or object where filtered tasks should be republished. |
| routing_key | str = None | The default routing key to use when republishing filtered tasks to the destination exchange. |
| source | List[Union[str, kombu.Queue]] = None | Optional list of source queue names or Queue instances to consume from; defaults to the application's configured task queues. |
| app | Celery = None | The Celery application instance to use for configuration and connection management. |
| callback | Callable = None | Optional function called after each successful message move, receiving (state, body, message) as arguments. |
| limit | int = None | The maximum number of messages to move before stopping the filtering process. |
| transform | Callable = None | Optional function to modify the destination value returned by the predicate before the task is republished. |
| **kwargs | dict | Additional keyword arguments passed directly to the underlying start_filter function. |
Returns
| Type | Description |
|---|---|
Any | The result of the underlying filter operation, typically indicating completion or the state of the message processing loop. |