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

Adding chain support on V2 protocol #113

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

liam-pulsation
Copy link

Description

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    feature

  • What is the current behavior? (You can also link to an open issue here)
    Actually, celery-node considers that the chain returned in embed.chain is always null

  • What is the new behavior (if this is a feature change)?

The goal was to implement the chain process in the celery-node library to fit our need for celery.chain with remote tasks (tasks that are not on the same server as the client, here Django). We were inspired by the Python code (celery/app/trace.trace_task) to implement the Worker.createTaskHandler function.

When launching the task, if it succeeds, we check if the received message has a chain. If it does, we call the sendChainTask method.

In the method, we extract the last item from the chain (the next task to be executed) and store it in a variable children. Then, we create a client (which will publish the task to the broker), using the queue defined in children. We create the message according to the Celery protocol V2. Finally, we push the message to the broker with client.sendTaskMessage.

  • Other information:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant