Skip to content

Equivalent of "SELF" within the task in Celery-Node Workers #55

@danielmichalichyn

Description

@danielmichalichyn

Hello @actumn, how are you?

Description

In Celery for python, when we define a task, within this task we can call a self argument to obtain some informations about the current running task, such as ID, Group, parentId, ETA... I was wondering how we can achieve the same result in the Celery-node worker.

Suggestion

Right now we pass some arguments to a task, like, args, kwargs and some to be implemented, that is the embed, that i've imagine is to make custom Kombu consumers. In the same way we cannot create some "self" object that contain all the header information and send to the task handler as well? So if the task have defined "args, kwargs and self", with this object we can obtain the information described above.

I'm willing to create a PR if we agree on the correct way to achieve this result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions