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)
| 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. |