Implement server lifecycle manager (lazy singleton) #128
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wayfinder child of: #126
Implement the lazy singleton that starts the Tank Royale Java server on first use with
-Iflag, manages the process, and kills it on exit. Needs to find the server JAR, pick a free port, wait for ready.Blocked by: nothing
Grilling Revisions
MAJOR CHANGE: External server, not embedded. The original spec assumed embedded server. Initial positions (
-Iflag) are incompatible withembeddedServer()mode —-Iis a server CLI flag, not a BattleRunner API property.Revised lifecycle:
java -jar $TANK_ROYALE_JAR -I --tps -1 --port PORTas a subprocessaddQuitProckills server process on exitJAR location:
TANK_ROYALE_JARenv var. Fail fast with clear message if not set or JAR not found.No
-Iflag on BattleRunner API — it's a server startup flag only. This is why external server is required.Spec additions from grilling
addExitProcto kill server process on program exit (covers normal exit, exceptions, signals).deferin any proc that starts the server as additional safety net.Dependency addition
Blocks: #130 (runBattle orchestrator), #134 (BattleRunner process lifecycle). Server must be running before either can operate.
Implemented in commit
57a1915.