class_docstr: Utility to watch the value of the cache entries with kind 'dataset-hub-cache'.
class_docstr_tok: ["Utility","to","watch","the","value","of","the","cache","entries","with","kind","'dataset-hub-cache","'","."]
docstr: Subscribe to random value changes for the given space.
  The caller is responsible for calling `self.unsubscribe` to release resources.
  
  Returns:
      (str, RandomValueChangedEvent):
          A 2-tuple containing a UUID and an instance of RandomValueChangedEvent.
          RandomValueChangedEvent can be `await`ed to be notified of updates to the random value.
          UUID must be passed when unsubscribing to release the associated resources.
docstr_tok: ["Subscribe","to","random","value","changes","for","the","given","space",".","The","caller","is","responsible","for","calling","`","self.unsubscribe","`","to","release","resources",".","Returns",":","(","str",",","RandomValueChangedEvent",")",":","A","2-tuple","containing","a","UUID","and","an","instance","of","RandomValueChangedEvent",".","RandomValueChangedEvent","can","be","`","await","`","ed","to","be","notified","of","updates","to","the","random","value",".","UUID","must","be","passed","when","unsubscribing","to","release","the","associated","resources","."]
code: def subscribe(self) -> tuple[str, HubCacheChangedEvent]:
      """
      Subscribe to random value changes for the given space.
      The caller is responsible for calling `self.unsubscribe` to release resources.
  
      Returns:
          (str, RandomValueChangedEvent):
              A 2-tuple containing a UUID and an instance of RandomValueChangedEvent.
              RandomValueChangedEvent can be `await`ed to be notified of updates to the random value.
              UUID must be passed when unsubscribing to release the associated resources.
      """
      return self._publisher._subscribe()
  
imports: import asyncio
  import contextlib
  from collections.abc import Mapping, Sequence
  from dataclasses import dataclass
  from http import HTTPStatus
  from typing import Any, Optional
  from uuid import uuid4
  from motor.motor_asyncio import AsyncIOMotorClient
  from pymongo.errors import PyMongoError
  from sse_api.constants import HUB_CACHE_KIND
label_desc: Use image node_id 4 for calling the HubCacheWatcher obj's underlying member method code with example usage: obj.subscribe() and returns: self