Repository navigation
docs: design note for AppService start/stop ordering - #35
Merged
Merged
Conversation
rocketraman
force-pushed
the
claude/service-ordering-design
branch
from
October 18, 2026 12:56
efd19ea to
b5cf694
Compare
rocketraman
marked this pull request as ready for review
October 19, 2026 22:25
Compares a global priority, phases, and provides/requires capabilities, and recommends phases with milestones inside a phase, so modules order against roles rather than each other's classes or numbers.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
rocketraman
force-pushed
the
claude/service-ordering-design
branch
from
October 19, 2026 22:26
2f02eb4 to
7774046
Compare
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.
Design note only, nothing implemented: docs/service-ordering.adoc.
It came up while reviewing #34, where the Flyway and Exposed services set their order as offsets from
JdbcDataSourceService.PRIORITY. The note compares four approaches: the current priority with named bands, phases (layers), provides/requires capabilities, and a hybrid of the last two.Recommendation: use a closed set of phases (
INFRASTRUCTURE,INITIALIZATION,APPLICATION,SERVING) for the coarse order and to give every service a default position. Inside a phase, services order themselves with typed milestones:after: order after the providers of a milestone, if any exist.requires: the same, but the boot fails if no provider exists.There is no priority. Services that the phases and milestones leave unordered have no guaranteed order. A
TieOrderbreaks ties by name (in production) or shuffled with a logged seed (in development and tests, viaboot-env) to surface missing milestones.priority()is deprecated for one release and still honoured, then removed. With this,boot-db-exposedruns afterDbMilestones.SchemaMigratedwithout knowing about Flyway or Liquibase, and with no migration tool the constraint is simply met. Bootable computes the start plan once, before any service starts. Missing providers, cycles and constraints that point at a later phase fail the boot with a clear message. Shutdown runs the start plan in reverse. Wiring is the same in vanilla, Kodein and Metro, and existing apps keep their current behaviour during the deprecation release.Customizable:
PhaseandMilestoneare interfaces, so an enum is all it takes to define your own. The phases, the default phase, and how each service's ordering is read (orderingOf) come from aStartOrderpassed toBootable;DefaultStartOrderis used when none is passed. An app can add a phase of its own, replace the phases (mapping library services' default phases onto its own), or override a library service's ordering from the composition root without subclassing it.