Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / class

RedisNotifier

codeintel.notify.RedisNotifier

PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.

PHAROS at 975a38dMIT license

Around this symbol

Search all symbols

Loading

Called by (1)
SymbolFileResolved by
get_notifiernotify.pysame file
Contains (3)
SymbolFileResolved by
__init__notify.pysame file
notifynotify.pysame file
waitnotify.pysame file
Inside (1)
SymbolFileResolved by
notifynotify.pysame file
codeintel.notify.RedisNotifierbackend/app/codeintel/notify.py, lines 50–74Open source
class RedisNotifier(Notifier):    name = "redis"    def __init__(self, url: str, key: str) -> None:        import redis        self.key = key        self._client = redis.Redis.from_url(url, socket_timeout=60, socket_connect_timeout=10)    def notify(self, job_id: str) -> bool:        try:            self._client.rpush(self.key, json.dumps({"job_id": job_id}))            return True        except Exception as exc:            logger.warning("Job notification failed (job stays queued in the DB): %s", type(exc).__name__)            return False    def wait(self, timeout: int) -> str | None:        try:            item = self._client.blpop([self.key], timeout=timeout)        except Exception as exc:            logger.warning("Redis BLPOP failed (%s); falling back to DB polling", type(exc).__name__)            time.sleep(min(timeout, 5))            return None        return _parse(item[1]) if item else None

What the index recorded

Signature
class RedisNotifier(Notifier):
File
backend/app/codeintel/notify.py
Lines
50–74
Parser
python-ast
Git blob
fc15788e6d2a98f2857ebab4c81c9c193abb5873
Outside this subset
1 more edges reach code outside the graph shown here

Read it on GitHub at this commit