rfc(submitqueue): add modular queue wiring#290
Conversation
8801dd0 to
3d8d47f
Compare
Design counter-proposal: declare, don't assembleFull end-to-end walkthrough (every construct defined, every file shown step by step): gist — declare, don't assemble. Summary below. The test that drove it: could another repo import submitqueue as a library and build an fx / plain-main / test-harness service from it? The core move: the RFC's extractions (and our first drafts of this feedback) still leave each service implementing assembly — four copies kept aligned by convention and review. The counter-proposal: each service declares itself as data, one shared engine assembles.
Highlights, each shown concretely in the gist:
The problem statement and the QueueConfig A/B/C analysis survive nearly verbatim — this mostly changes the extraction plan's shape. Happy to pair on the rewrite. |
|
@JamyDev @behinddwalls can we have something fluent like this? or if some config needs to come from YAML for practical reasons (Uber infra): |
|
I think we can add something on top to allow for a fluent builder yea |
Propose extracting per-queue extension profiles, topic-registry builder, and controller registration from the orchestrator example main.go into reusable domain packages, plus data-driven profile hints in QueueConfig. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…onfig removal Analyze three options for per-queue extension selection in light of potential QueueConfig removal: hints in the entity, a separate profile config file, or keeping profiles in Go code only. Recommends landing the mechanical extractions (steps 1-3) unconditionally and deferring step 4 until the QueueConfig question is resolved. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…pproach Incorporate the counter-proposal from the design gist: replace the original 5-step extraction plan with a unified pipeline.Construct[D] engine + lifecycle.Component approach. Services declare themselves as Deps struct + Stages slice + Controllers struct; the engine handles topic registry, DLQ pairing, consumer lifecycle, and startup ordering. Key changes: - Add vocabulary section and library/host boundary diagram - Replace steps 1-5 with the engine-based Steps 1-5 (lifecycle, pipeline, service self-declaration, host profiles, host main) - Simplify QueueConfig trade-off: recommend option C (profiles stay in Go code, host-private) over data-driven profile hints - Show how the pattern generalizes across all four services - Add "what the engine enforces" invariants table Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3d8d47f to
0387fe7
Compare
Avoids confusion between the Builder type and its terminal method, per review feedback from @behindwalls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous description referenced adding profile hints to QueueConfig, which the RFC's recommended option (C) explicitly avoids. Updated to reflect the current design: a typed engine, service self-declaration, and host-owned profiles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
||
| func New() *Builder { return &Builder{perQueue: map[string]Profile{}} } | ||
|
|
||
| func (b *Builder) WithLogger(l *zap.SugaredLogger) *Builder { b.logger = l; return b } |
There was a problem hiding this comment.
we can drop With feels verbose
Renames WithLogger→Logger, WithScope→Scope, WithStorage→Storage, WithMessageQueue→MessageQueue, WithQueue→Queue, WithOption→Option, WithChangeProvider→ChangeProvider, WithBuildRunner→BuildRunner, WithScorer→Scorer, WithConflictAnalyzer→ConflictAnalyzer. Also renames Queue() constructor to NewQueue() since Queue is now a Builder method name. Per review feedback from @behindwalls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
RFC at
doc/rfc/submitqueue/modular-queue-wiring.mdproposing a declare-don't-assemble engine for the orchestrator's per-queue extension wiring, topic registry, and controller lifecycle:platform/lifecycle—Componentinterface (Start/Stop) and orderedGroupwith rollback-on-partial-failureplatform/pipeline—Construct[D]engine that unifies topic registry, controller creation, DLQ pairing, and consumer lifecycle into one typed call over a[]Stage[D]tableDepsstruct (seams), aStagesslice (topology), and aControllersstruct; no assembly codeprofiles.go, never crosses the library boundarysubmitqueue.New().WithQueue(...).Create()wraps the engine for the common single-orchestrator caseRecommends profiles stay in Go code (Option C) rather than adding hints to
QueueConfig. Also adds the RFC todoc/rfc/index.md.Doc-only change, no code modifications.
Test Plan
CI/Build validation
Revert Plan
git revert
API Changes
No API changes
Monitoring and Alerts
Standard monitoring via existing dashboards