(self, main=None, loader=None, backend=None,
amqp=None, events=None, log=None, control=None,
set_as_current=True, tasks=None, broker=None, include=None,
changes=None, config_source=None, fixups=None, task_cls=None,
autofinalize=True, namespace=None, strict_typing=True,
**kwargs)
| 337 | on_after_fork = None |
| 338 | |
| 339 | def __init__(self, main=None, loader=None, backend=None, |
| 340 | amqp=None, events=None, log=None, control=None, |
| 341 | set_as_current=True, tasks=None, broker=None, include=None, |
| 342 | changes=None, config_source=None, fixups=None, task_cls=None, |
| 343 | autofinalize=True, namespace=None, strict_typing=True, |
| 344 | **kwargs): |
| 345 | |
| 346 | self._local = threading.local() |
| 347 | self._backend_cache = None |
| 348 | |
| 349 | self.clock = LamportClock() |
| 350 | self.main = main |
| 351 | self.amqp_cls = amqp or self.amqp_cls |
| 352 | self.events_cls = events or self.events_cls |
| 353 | self.loader_cls = loader or self._get_default_loader() |
| 354 | self.log_cls = log or self.log_cls |
| 355 | self.control_cls = control or self.control_cls |
| 356 | self._custom_task_cls_used = ( |
| 357 | # Custom task class provided as argument |
| 358 | bool(task_cls) |
| 359 | # subclass of Celery with a task_cls attribute |
| 360 | or self.__class__ is not Celery and hasattr(self.__class__, 'task_cls') |
| 361 | ) |
| 362 | self.task_cls = task_cls or self.task_cls |
| 363 | self.set_as_current = set_as_current |
| 364 | self.registry_cls = symbol_by_name(self.registry_cls) |
| 365 | self.user_options = defaultdict(set) |
| 366 | self.steps = defaultdict(set) |
| 367 | self.autofinalize = autofinalize |
| 368 | self.namespace = namespace |
| 369 | self.strict_typing = strict_typing |
| 370 | |
| 371 | self.configured = False |
| 372 | self._config_source = config_source |
| 373 | self._pending_defaults = deque() |
| 374 | self._pending_periodic_tasks = deque() |
| 375 | |
| 376 | self.finalized = False |
| 377 | self._finalize_mutex = threading.RLock() |
| 378 | self._pending = deque() |
| 379 | self._tasks = tasks |
| 380 | if not isinstance(self._tasks, TaskRegistry): |
| 381 | self._tasks = self.registry_cls(self._tasks or {}) |
| 382 | |
| 383 | # If the class defines a custom __reduce_args__ we need to use |
| 384 | # the old way of pickling apps: pickling a list of |
| 385 | # args instead of the new way that pickles a dict of keywords. |
| 386 | self._using_v1_reduce = app_has_custom(self, '__reduce_args__') |
| 387 | |
| 388 | # these options are moved to the config to |
| 389 | # simplify pickling of the app object. |
| 390 | self._preconf = changes or {} |
| 391 | self._preconf_set_by_auto = set() |
| 392 | self.__autoset('broker_url', broker) |
| 393 | self.__autoset('result_backend', backend) |
| 394 | self.__autoset('include', include) |
| 395 | |
| 396 | for key, value in kwargs.items(): |
nothing calls this directly
no test coverage detected