MCPcopy
hub / github.com/celery/celery / apply

Method apply

celery/canvas.py:355–367  ·  view source on GitHub ↗

Call task locally. Same as :meth:`apply_async` but executed the task inline instead of sending a task message.

(self, args=None, kwargs=None, **options)

Source from the content-addressed store, hash-verified

353 return self.apply_async(partial_args, partial_kwargs)
354
355 def apply(self, args=None, kwargs=None, **options):
356 """Call task locally.
357
358 Same as :meth:`apply_async` but executed the task inline instead
359 of sending a task message.
360 """
361 args = args if args else ()
362 kwargs = kwargs if kwargs else {}
363 # Extra options set to None are dismissed
364 options = {k: v for k, v in options.items() if v is not None}
365 # For callbacks: extra args are prepended to the stored args.
366 args, kwargs, options = self._merge(args, kwargs, options)
367 return self.type.apply(args, kwargs, **options)
368
369 def apply_async(self, args=None, kwargs=None, route_name=None, **options):
370 """Apply this task asynchronously.

Callers

nothing calls this directly

Calls 3

_mergeMethod · 0.95
itemsMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected