class_docstr: Manage the background execution of callbacks with subprocesses and a diskcache result backend.
class_docstr_tok: ["Manage","the","background","execution","of","callbacks","with","subprocesses","and","a","diskcache","result","backend","."]
docstr: Long callback manager that runs callback logic in a subprocess and stores
  results on disk using diskcache
  
  :param cache:
      A diskcache.Cache or diskcache.FanoutCache instance. See the diskcache
      documentation for information on configuration options. If not provided,
      a diskcache.Cache instance will be created with default values.
  :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 ``cache`` instance.
docstr_tok: ["Long","callback","manager","that","runs","callback","logic","in","a","subprocess","and","stores","results","on","disk","using","diskcache",":","param","cache",":","A","diskcache.Cache","or","diskcache.FanoutCache","instance",".","See","the","diskcache","documentation","for","information","on","configuration","options",".","If","not","provided",",","a","diskcache.Cache","instance","will","be","created","with","default","values",".",":","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","``","cache","``","instance","."]
code: def __init__(self, cache=None, cache_by=None, expire=None):
      """
      Long callback manager that runs callback logic in a subprocess and stores
      results on disk using diskcache
  
      :param cache:
          A diskcache.Cache or diskcache.FanoutCache instance. See the diskcache
          documentation for information on configuration options. If not provided,
          a diskcache.Cache instance will be created with default values.
      :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 ``cache`` instance.
      """
      try:
          import diskcache  # pylint: disable=import-outside-toplevel
          import psutil  # noqa: F401,E402 pylint: disable=import-outside-toplevel,unused-import,unused-variable,import-error
          import multiprocess  # noqa: F401,E402 pylint: disable=import-outside-toplevel,unused-import,unused-variable
      except ImportError as missing_imports:
          raise ImportError(
              """\
  DiskcacheLongCallbackManager requires extra dependencies which can be installed doing
  
      $ pip install "dash[diskcache]"\n"""
          ) from missing_imports
  
      if cache is None:
          self.handle = diskcache.Cache()
      else:
          if not isinstance(
              cache, (diskcache.Cache, diskcache.FanoutCache)
          ):
              raise ValueError(
                  "First argument must be a diskcache.Cache "
                  "or diskcache.FanoutCache object"
              )
          self.handle = cache
  
      self.expire = expire
      super().__init__(cache_by)
  
imports: import traceback
  from contextvars import copy_context
  from .None import BaseLongCallbackManager
  from ..._callback_context import context_value
  from ..._utils import AttributeDict
  from ...exceptions import PreventUpdate
label_desc: Use image node_id 1 to create a new DiskcacheManager object from inherited base classes: BaseLongCallbackManager with example: obj = DiskcacheManager(cache, cache_by, expire)