class_docstr: Manage background execution of callbacks with a celery queue.
class_docstr_tok: ["Manage","background","execution","of","callbacks","with","a","celery","queue","."]
docstr: Long callback manager that runs callback logic on a celery task queue,
  and stores results using a celery result backend.
  
  :param celery_app:
      A celery.Celery application instance that must be configured with a
      result backend. See the celery documentation for information on
      configuration options.
  :param cache_by:
      A list of zero-argument functions.  When provided, caching is enabled and
      the return values of these functions are combined with the callback
      function's input arguments and source code to generate cache keys.
  :param expire:
      If provided, a cache entry will be removed when it has not been accessed
      for ``expire`` seconds.  If not provided, the lifetime of cache entries
      is determined by the default behavior of the celery result backend.
docstr_tok: ["Long","callback","manager","that","runs","callback","logic","on","a","celery","task","queue",",","and","stores","results","using","a","celery","result","backend",".",":","param","celery_app",":","A","celery.Celery","application","instance","that","must","be","configured","with","a","result","backend",".","See","the","celery","documentation","for","information","on","configuration","options",".",":","param","cache_by",":","A","list","of","zero-argument","functions",".","When","provided",",","caching","is","enabled","and","the","return","values","of","these","functions","are","combined","with","the","callback","function","'s","input","arguments","and","source","code","to","generate","cache","keys",".",":","param","expire",":","If","provided",",","a","cache","entry","will","be","removed","when","it","has","not","been","accessed","for","``","expire","``","seconds",".","If","not","provided",",","the","lifetime","of","cache","entries","is","determined","by","the","default","behavior","of","the","celery","result","backend","."]
code: def __init__(self, celery_app, cache_by=None, expire=None):
      """
      Long callback manager that runs callback logic on a celery task queue,
      and stores results using a celery result backend.
  
      :param celery_app:
          A celery.Celery application instance that must be configured with a
          result backend. See the celery documentation for information on
          configuration options.
      :param cache_by:
          A list of zero-argument functions.  When provided, caching is enabled and
          the return values of these functions are combined with the callback
          function's input arguments and source code to generate cache keys.
      :param expire:
          If provided, a cache entry will be removed when it has not been accessed
          for ``expire`` seconds.  If not provided, the lifetime of cache entries
          is determined by the default behavior of the celery result backend.
      """
      try:
          import celery  # pylint: disable=import-outside-toplevel,import-error
          from celery.backends.base import (  # pylint: disable=import-outside-toplevel,import-error
              DisabledBackend,
          )
      except ImportError as missing_imports:
          raise ImportError(
              """\
  CeleryLongCallbackManager requires extra dependencies which can be installed doing
  
      $ pip install "dash[celery]"\n"""
          ) from missing_imports
  
      if not isinstance(celery_app, celery.Celery):
          raise ValueError(
              "First argument must be a celery.Celery object"
          )
  
      if isinstance(celery_app.backend, DisabledBackend):
          raise ValueError(
              "Celery instance must be configured with a result backend"
          )
  
      self.handle = celery_app
      self.expire = expire
      super().__init__(cache_by)
  
imports: import json
  import traceback
  from contextvars import copy_context
  from _plotly_utils.utils import PlotlyJSONEncoder
  from dash._callback_context import context_value
  from dash._utils import AttributeDict
  from dash.exceptions import PreventUpdate
  from dash.long_callback.managers import BaseLongCallbackManager
label_desc: Use image node_id 1 to create a new CeleryManager object from inherited base classes: BaseLongCallbackManager with example: obj = CeleryManager(celery_app, cache_by, expire)