Implement server lifecycle hooks (on_boot, on_shutdown, on_tick, on_save, on_reload) #84

Open
opened 2026-03-15 04:13:04 +00:00 by freemo · 0 comments
Owner

Metadata

  • Commit Message: feat(lifecycle): add server lifecycle hooks
  • Branch: feature/m1-lifecycle-hooks

Background and Context

The specification defines five server-level lifecycle hooks that fire at key moments in
the server's lifecycle. These hooks allow subsystems (event sourcing, monitoring, etc.)
to register for notifications without tight coupling to the server code.

Expected Behavior

  • on_boot fires after Manager#initialize completes and all objects are loaded
  • on_shutdown fires when the server begins graceful shutdown
  • on_tick fires each game tick (update cycle)
  • on_save fires before and after periodic save_all operations
  • on_reload fires when areload hot-reloads source files

Acceptance Criteria

  • Hook emission points added to Server#initialize, shutdown path, update loop,
    save cycle, and reload handler
  • Each hook passes appropriate context in the HookEvent data
  • BDD scenarios verify hooks fire at correct times

Subtasks

  • Add on_boot emission to server startup
  • Add on_shutdown emission to graceful shutdown path
  • Add on_tick emission to the update loop
  • Add on_save emission (before/after) to save cycle
  • Add on_reload emission to the areload handler
  • Write Cucumber feature file and step definitions

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the
    Commit Message in Metadata exactly.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata.
  • The commit is submitted as a pull request to master, reviewed, and merged.
## Metadata - **Commit Message**: `feat(lifecycle): add server lifecycle hooks` - **Branch**: `feature/m1-lifecycle-hooks` ## Background and Context The specification defines five server-level lifecycle hooks that fire at key moments in the server's lifecycle. These hooks allow subsystems (event sourcing, monitoring, etc.) to register for notifications without tight coupling to the server code. ## Expected Behavior - `on_boot` fires after `Manager#initialize` completes and all objects are loaded - `on_shutdown` fires when the server begins graceful shutdown - `on_tick` fires each game tick (update cycle) - `on_save` fires before and after periodic `save_all` operations - `on_reload` fires when `areload` hot-reloads source files ## Acceptance Criteria - Hook emission points added to `Server#initialize`, shutdown path, update loop, save cycle, and reload handler - Each hook passes appropriate context in the `HookEvent` data - BDD scenarios verify hooks fire at correct times ## Subtasks - [ ] Add `on_boot` emission to server startup - [ ] Add `on_shutdown` emission to graceful shutdown path - [ ] Add `on_tick` emission to the update loop - [ ] Add `on_save` emission (before/after) to save cycle - [ ] Add `on_reload` emission to the `areload` handler - [ ] Write Cucumber feature file and step definitions ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged**.
freemo added this to the v1.3.0 milestone 2026-03-15 04:13:04 +00:00
freemo self-assigned this 2026-03-15 04:25:23 +00:00
freemo modified the milestone from v1.3.0 to v1.0.0 2026-03-16 00:27:57 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: aethyr/Aethyr#84
No description provided.