Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / class
_Bucket
codeintel.edge_server._Bucket
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 symbolsLoading
| Symbol | File | Resolved by |
|---|---|---|
| make_handler | edge_server.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| edge_server | edge_server.py | same file |
codeintel.edge_server._Bucketbackend/app/codeintel/edge_server.py, lines 42–55Open source
class _Bucket: def __init__(self, rate: float, burst: int): self.rate, self.burst, self.tokens, self.at = rate, burst, float(burst), time.monotonic() self.lock = threading.Lock() def take(self) -> bool: with self.lock: now = time.monotonic() self.tokens = min(self.burst, self.tokens + (now - self.at) * self.rate) self.at = now if self.tokens >= 1: self.tokens -= 1 return True return FalseWhat the index recorded
- Signature
class _Bucket:- File
backend/app/codeintel/edge_server.py- Lines
- 42–55
- Parser
- python-ast
- Git blob
909dfc0fcf1334828a534248afdadb1c50262110- Outside this subset
- 2 more edges reach code outside the graph shown here
