Background
In #193 (per-queue extension wiring), the example orchestrator's main.go
(example/submitqueue/orchestrator/server/main.go)
grew to construct the full set of configured dependencies inline — queue
registry, the six per-extension factory adapters, consumers, etc. Review
feedback (thread):
I think we should start moving dependencies building out of main.go - it
becomes overbloated and hard to read. Probably even introduce another
high-level concept of a "service" - an entity holding the combined set of
configured dependencies. main.go to remain as a runner of the service.
Proposal
Introduce a higher-level service concept that owns the assembled,
configured set of dependencies, and reduce main.go to a thin runner.
- Extract dependency construction (queue registry, per-extension factory
adapters, stores, consumers, …) out of main.go into a dedicated
service-assembly type/package.
main.go responsibilities shrink to: parse flags/config, build the
service, start it, handle shutdown.
- Keep the wiring-layer ownership boundary intact — per-queue routing and
factory adapters still live in the wiring layer (see the Extensions
guidance in CLAUDE.md), just organized behind the service rather than
spelled out in main.go.
Scope / open questions
Follow-up to #193 (raised by @sbalabanov).
Background
In #193 (per-queue extension wiring), the example orchestrator's
main.go(
example/submitqueue/orchestrator/server/main.go)grew to construct the full set of configured dependencies inline — queue
registry, the six per-extension factory adapters, consumers, etc. Review
feedback (thread):
Proposal
Introduce a higher-level service concept that owns the assembled,
configured set of dependencies, and reduce
main.goto a thin runner.adapters, stores, consumers, …) out of
main.gointo a dedicatedservice-assembly type/package.
main.goresponsibilities shrink to: parse flags/config, build theservice, start it, handle shutdown.
factory adapters still live in the wiring layer (see the Extensions
guidance in
CLAUDE.md), just organized behind the service rather thanspelled out in
main.go.Scope / open questions
example/submitqueue/...vs. promoting areusable assembly into
submitqueue/core/). feat(example): per-queue extension wiring; retire buildrunner/noop #193 already left a TODO toevaluate promoting the registry into
submitqueue/corelater.stovepipe servers.
Follow-up to #193 (raised by @sbalabanov).