queue: make the queue backend pluggable - #177
Open
marcopiraccini wants to merge 3 commits into
Open
Conversation
Centralize the queue-name grammar in queue/names.ts, mirroring
@workflow/world's queue.ts: the spec allows an optional namespace between the
sentinel and the kind (__{namespace}_wkf_workflow_<id>, from
WORKFLOW_QUEUE_NAMESPACE), which three call sites did not account for.
routeMessage already matched the namespaced form with its own inline regex, but
the failure-finalization paths in the poller matched the bare
'__wkf_workflow_' / '__wkf_step_' literals, so a namespaced delivery skipped
failRun and its workflow name was sliced at the wrong offset. The replay
fallback in run-actions had the same literal. All of them now share one
definition, and the router's duplicate regex is gone with it.
Also wire the VersionExpired error, which was defined but never thrown: an
enqueue targeting an expired deployment version now answers 410 instead of
accepting a message routeMessage will refuse to dispatch, and the World client
implements the spec's optional isDeploymentUnavailableError() so the SDK can
re-route rather than burn ten delivery attempts. Draining versions still accept
work, matching routeMessage.
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
marcopiraccini
marked this pull request as ready for review
August 28, 2026 15:23
ShogunPanda
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
QueueStore,BrokerTransport, andCoordinatorinterfaces.Dependency
This PR is stacked on #176, which has not been merged yet. Review and merge #176 first.
This introduces the extension points and retains PostgreSQL behavior. External Redis or SQS transports are intentionally left for the next phase.