MCPcopy
hub / github.com/celery/celery / bind

Method bind

celery/app/task.py:363–386  ·  view source on GitHub ↗
(cls, app)

Source from the content-addressed store, hash-verified

361
362 @classmethod
363 def bind(cls, app):
364 was_bound, cls.__bound__ = cls.__bound__, True
365 cls._app = app
366 conf = app.conf
367 cls._exec_options = None # clear option cache
368
369 if cls.typing is None:
370 cls.typing = app.strict_typing
371
372 for attr_name, config_name in cls.from_config:
373 if getattr(cls, attr_name, None) is None:
374 setattr(cls, attr_name, conf[config_name])
375
376 # decorate with annotations from config.
377 if not was_bound:
378 cls.annotate()
379
380 from celery.utils.threads import LocalStack
381 cls.request_stack = LocalStack()
382
383 # PeriodicTask uses this to add itself to the PeriodicTask schedule.
384 cls.on_bound(app)
385
386 return app
387
388 @classmethod
389 def on_bound(cls, app):

Callers 7

get_avail_portMethod · 0.80
_get_appMethod · 0.80
wrapperFunction · 0.80
_task_from_funMethod · 0.80
register_taskMethod · 0.80
finalizeMethod · 0.80

Calls 2

on_boundMethod · 0.80
annotateMethod · 0.45

Tested by 1