celery.node icon indicating copy to clipboard operation
celery.node copied to clipboard

Self variable - Issue #55

Open danielmichalichyn opened this issue 4 years ago • 1 comments

Hello @actumn, how are you?

Description

Regarding the issue #55, I've created this PR to suggest to you a simple way to achieve the result mentioned in the issue. A "self" variable within the task, so we can have information about task ID, and some other configurations made in the Celery Client. With this we can, from the worker, implement some others functions, like log the task ID, retry a task, and so on...

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) Adding a SELF variable to the task function.

  • **What is the current behavior? ** (You can also link to an open issue here) #55

I'm open to suggestion and we can discuss if this is the better way.

danielmichalichyn avatar May 24 '21 19:05 danielmichalichyn

Hi, @danielmichalichyn! Greatly appreciated for submitting this awesome PR!

A little request, it would be better if there are some use cases or descriptions to show how to use it with self. Can you share what you've imagined?

actumn avatar May 26 '21 13:05 actumn