Skip to content

Split queue logic into StateQueries and CAS-owning services - #2

Merged
janbjorge merged 2 commits into
mainfrom
queries-and-services
Sep 28, 2026
Merged

janbjorge merged 2 commits into
mainfrom
queries-and-services

Conversation

@janbjorge

@janbjorge janbjorge commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner
  • StateQueries (core/queries.py): pure job lifecycle ops on one QueueState snapshot.
  • DirectQueue / GroupCommitLoop: services that own storage I/O and the CAS cycle.
  • Removes duplicated claim/nack/heartbeat closures and nonlocal result passing.
  • Adds queries-and-services.md and tests/test_queries.py. Public API unchanged.

Adapt the Queries/Services ADR to jqueue's object-storage model:
StateQueries (core/queries.py) holds pure, synchronous job lifecycle
operations on one QueueState snapshot; DirectQueue and GroupCommitLoop
are services that own storage I/O and the CAS transaction boundary.

This removes the duplicated claim/nack/heartbeat closures in both
services and replaces nonlocal result passing with typed
Callable[[StateQueries], T] units of work. Public API is unchanged.

Adds queries-and-services.md (ADR) and tests/test_queries.py.
@janbjorge
janbjorge merged commit b35cca7 into main Sep 28, 2026
4 checks passed
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.

1 participant