Skip to content

Support manual routing. #94

@comfuture

Description

@comfuture

Description

Celery can specify the queue name and routing_key manually at the task message.

https://docs.celeryq.dev/en/stable/userguide/routing.html#manual-routing

from my.tasks import add
add.apply_async(args=[1, 2], queue='math_tasks', routing_key='math.queue')

I hope that celery.node can also receive the queue name as a variable argument of the client.createTask() method.

  • Proposed Behavior
// suggestion 1. pass the queue name as 2nd argument of `createTask` method.
const task = client.createTask('add', {queue: 'math_tasks'})
const answer = await task.applyAsync([1, 2]).get()

// or

// suggestion 2. pass the queue name as 3rd argument of `task.applyAsync` method.
// This is a little more Python-like, but requires passing an empty argument when no kwargs are present.
const task = client.createTask('add')
const answer = await task.applyAsync([1, 2], {}, {queue: 'math_tasks'}).get()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions