Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support manual routing. #94

Open
comfuture opened this issue Dec 5, 2022 · 0 comments
Open

Support manual routing. #94

comfuture opened this issue Dec 5, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@comfuture
Copy link

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()
@comfuture comfuture added the enhancement New feature or request label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant