Skip to content

feat(core): add AsyncCacheableSource and cacheable-source wiring#938

Open
chrisburr wants to merge 2 commits into
DIRACGrid:mainfrom
chrisburr:rss-3-cacheable-source
Open

feat(core): add AsyncCacheableSource and cacheable-source wiring#938
chrisburr wants to merge 2 commits into
DIRACGrid:mainfrom
chrisburr:rss-3-cacheable-source

Conversation

@chrisburr

@chrisburr chrisburr commented Jun 11, 2026

Copy link
Copy Markdown
Member

Adds a generic diracx.core.sources module with AsyncCacheableSource and
Snapshot, a diracx.cacheable_sources entry-point group, and application
factory support: each source is instantiated once per app (so its caches
persist across requests) with the database instance matching its
db_class, and its read method overrides the create dependency for every
implementation class so extensions can substitute their own sources.
Routers depending on a source whose database is not available fail at
startup, consistent with the handling of missing databases.

Replaces #910
Part of #839

Blocked by #936

@read-the-docs-community

read-the-docs-community Bot commented Jun 11, 2026

Copy link
Copy Markdown

Documentation build overview

📚 diracx | 🛠️ Build #33202357 | 📁 Comparing 8cf3bd6 against latest (0484464)

  🔍 Preview build  

152 files changed · + 1 added · ± 151 modified

+ Added

± Modified

@chrisburr chrisburr linked an issue Jun 11, 2026 that may be closed by this pull request
5 tasks
@fstagni fstagni requested a review from Loxeris June 15, 2026 08:16
@fstagni

fstagni commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Why is this still a draft? The blocking PR has been merged.

@Loxeris I assigned you as reviewer.

@chrisburr chrisburr force-pushed the rss-3-cacheable-source branch from 974be41 to e24e414 Compare June 18, 2026 11:40
@chrisburr

Copy link
Copy Markdown
Member Author

It needed rebasing, done now.

@chrisburr chrisburr marked this pull request as ready for review June 18, 2026 11:40
Comment thread diracx-core/src/diracx/core/sources.py
@chrisburr chrisburr requested a review from Loxeris June 18, 2026 14:45
chrisburr and others added 2 commits June 18, 2026 16:45
Adds a generic diracx.core.sources module with AsyncCacheableSource and
Snapshot, a diracx.cacheable_sources entry-point group, and application
factory support: each source is instantiated once per app (so its caches
persist across requests) with the database instance matching its
db_class, and its read method overrides the create dependency for every
implementation class so extensions can substitute their own sources.
Routers depending on a source whose database is not available fail at
startup, consistent with the handling of missing databases.

Co-authored-by: Loxeris <30194187+Loxeris@users.noreply.github.com>
Co-locate the sync CacheableSource base class with its async sibling
AsyncCacheableSource in diracx.core.sources, leaving diracx.core.config.sources
to hold only config-specific sources. CacheableSource is fully generic and only
lived in the config module for historical reasons.

diracx.core.config still re-exports CacheableSource, so existing imports keep
working.
@chrisburr chrisburr force-pushed the rss-3-cacheable-source branch from 32fe963 to 8cf3bd6 Compare June 18, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ResourceStatusSource + route

3 participants