Commit 8ea4619
feat: fetch metadata sources concurrently (#111)
## Summary
- run independent DOI metadata sources concurrently while preserving
deterministic merge priority
- run PMID and arXiv fallback candidates concurrently only after their
primary source fails
- add `async_from_identifier()` and async feeder methods without
removing the synchronous API
- use the existing rate-limited `requests` session in native worker
threads
- use `pyodide.http.pyfetch` with `asyncio.gather`, retries, timeouts,
and browser-side rate limiting in Pyodide
- keep the Web UI as a thin wrapper around the Python package
- retain a synchronous Web fallback until the async package version is
published to PyPI
- add concurrency and transport regression tests
## Why
The source chain previously waited for each independent network service
before starting the next. DOI metadata is merged from several
independent sources, so most of that latency can overlap. Pyodide cannot
rely on native Python worker threads, so the browser path uses an async
Fetch-based transport instead.
Fallback-only services remain lazy to avoid unnecessary API traffic.
Source priority and merge order are unchanged.
## Validation
- `python -m compileall` on the changed Python sources: passed
- `node --check docs/wenxian.js`: passed
- branch is based directly on the current upstream `master` (`a1e2c8f`)
- full repository CI is expected to validate lint, typing, tests, and
coverage on this PR
Agent: ChatGPT
Model: GPT-5.6 Sol
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent a1e2c8f commit 8ea4619
14 files changed
Lines changed: 1877 additions & 352 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| |||
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
24 | | - | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
39 | | - | |
40 | 43 | | |
41 | | - | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
0 commit comments