Epic: EventMachine Network Migration #88

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

Metadata

  • Commit Message: feat(server): migrate network layer to EventMachine
  • Branch: feature/eventmachine-migration

Background and Context

The specification and CONTRIBUTING.md describe EventMachine as the target network
architecture. The current server main loop in Server#initialize uses IO.select
with raw socket multiplexing. EventMachine is already a gem dependency but is not
used for the main event loop. Completing this migration provides non-blocking I/O,
built-in timer management, and the reactor pattern the terminal UI depends on.

Expected Behavior

The server boots into an EventMachine reactor loop. Client connections are handled
via EventMachine::Connection subclasses. Periodic tasks use EventMachine.add_periodic_timer.

Acceptance Criteria

  • IO.select loop replaced with EventMachine.run reactor
  • PlayerConnection ported to EventMachine::Connection
  • Concurrent::TimerTask instances replaced with EM timers
  • All existing BDD tests pass with the new network layer
  • Server accepts connections and handles input/output correctly

Subtasks

  • Replace IO.select server loop with EventMachine reactor
  • Port PlayerConnection to EventMachine connection handler
  • Migrate periodic tasks to EventMachine timers

Definition of Done

This Epic is complete when all child issues are closed and all acceptance criteria
are satisfied.

## Metadata - **Commit Message**: `feat(server): migrate network layer to EventMachine` - **Branch**: `feature/eventmachine-migration` ## Background and Context The specification and CONTRIBUTING.md describe EventMachine as the target network architecture. The current server main loop in `Server#initialize` uses `IO.select` with raw socket multiplexing. EventMachine is already a gem dependency but is not used for the main event loop. Completing this migration provides non-blocking I/O, built-in timer management, and the reactor pattern the terminal UI depends on. ## Expected Behavior The server boots into an EventMachine reactor loop. Client connections are handled via `EventMachine::Connection` subclasses. Periodic tasks use `EventMachine.add_periodic_timer`. ## Acceptance Criteria - `IO.select` loop replaced with `EventMachine.run` reactor - `PlayerConnection` ported to `EventMachine::Connection` - `Concurrent::TimerTask` instances replaced with EM timers - All existing BDD tests pass with the new network layer - Server accepts connections and handles input/output correctly ## Subtasks - [ ] Replace IO.select server loop with EventMachine reactor - [ ] Port PlayerConnection to EventMachine connection handler - [ ] Migrate periodic tasks to EventMachine timers ## Definition of Done This Epic is complete when all child issues are closed and all acceptance criteria are satisfied.
freemo added this to the v1.3.0 milestone 2026-03-15 04:13:06 +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:58 +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#88
No description provided.