MCPcopy Create free account
hub / github.com/celery/celery / __reduce__

Method __reduce__

celery/app/task.py:557–565  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

555 __class_getitem__ = classmethod(types.GenericAlias)
556
557 def __reduce__(self):
558 # - tasks are pickled into the name of the task only, and the receiver
559 # - simply grabs it from the local registry.
560 # - in later versions the module of the task is also included,
561 # - and the receiving side tries to import that module so that
562 # - it will work even if the task hasn't been registered.
563 mod = type(self).__module__
564 mod = mod if mod and mod in sys.modules else None
565 return (_unpickle_task_v2, (self.name, mod), None)
566
567 def run(self, *args, **kwargs):
568 """The body of the task executed by workers."""

Callers 1

test_reduce_directMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_reduce_directMethod · 0.76