Skip to content

refactor: split the shard module - #419

Merged
kacy merged 1 commit into
mainfrom
refactor/split-shard
Sep 24, 2026
Merged

kacy merged 1 commit into
mainfrom
refactor/split-shard

Conversation

@kacy

@kacy kacy commented Sep 24, 2026

Copy link
Copy Markdown
Owner

ember-core/src/shard/mod.rs was about 3,000 lines and mixed three concerns. It now has three files:

  • shard/request.rs: the shard_request! macro, ShardRequest, ShardResponse and ShardMessage, about 500 lines. They are re-exported from shard as before, so no paths outside the module change.
  • shard/dispatch.rs: dispatch, which maps each request to a keyspace operation, and its small helpers, about 980 lines.
  • shard/mod.rs: the shard handle, startup and recovery wiring, the message loop and the tests, about 1,500 lines.

The code moved unchanged. dispatch and is_write became pub(super) so the rest of the shard can call them. Core tests pass with and without the optional features, and the server builds unchanged.

shard/mod.rs was about 3,000 lines. The request and response types move
to shard/request.rs and dispatch, which maps each request to a keyspace
operation, moves to shard/dispatch.rs. mod.rs keeps the shard handle,
startup and the message loop. No code changed.
@kacy
kacy merged commit 24493b4 into main Sep 24, 2026
12 checks passed
@kacy
kacy deleted the refactor/split-shard branch September 24, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant