Back to the room

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

Code Observatory / Source

Resolve pointers concurrently

Eight workers at most. It never raises, so one unavailable file cannot fail the response.

PINNED SOURCE Copied from the repository at this commit. Source, not an execution.

PHAROS at 975a38dMIT license

resolve_sourcesbackend/app/codeintel/source.py, lines 165–173Open source
def resolve_sources(requests: list[SourceRequest], token: str | None = None) -> dict[str, SourceResult]:    """Resolve many pointers concurrently; never raises."""    if not requests:        return {}    if len(requests) == 1:        return {requests[0].key: _resolve_one(requests[0], token)}    with concurrent.futures.ThreadPoolExecutor(max_workers=min(FETCH_CONCURRENCY, len(requests))) as pool:        results = list(pool.map(lambda r: _resolve_one(r, token), requests))    return {r.key: r for r in results}

Where this comes from

Commit
975a38d5d17839c26ee219295a5be6ac66b6d910
File
backend/app/codeintel/source.py
Lines
165–173
Git blob
c9f05cf7bf871b09919d64e9fdaf8380ecc3df2c
License
MIT, © 2024–2026 Pharos Contributors. Notice

Read it on GitHub at this commit

Check it yourself

From a clone of the repository, the first command prints the blob above and the second prints these lines.

git rev-parse 975a38d:backend/app/codeintel/source.py
git show 975a38d:backend/app/codeintel/source.py | sed -n '165,173p'