Skip to content

refactor: replace grpc pipeline dispatch with macro#128

Merged
kacy merged 1 commit intomainfrom
refactor/grpc-pipeline-macro
Feb 14, 2026
Merged

refactor: replace grpc pipeline dispatch with macro#128
kacy merged 1 commit intomainfrom
refactor/grpc-pipeline-macro

Conversation

@kacy
Copy link
Copy Markdown
Owner

@kacy kacy commented Feb 14, 2026

summary

  • replaced 57 identical match arms in handle_pipeline_command with a pipeline_dispatch! macro
  • each arm followed the same pattern: call service method → wrap in PipelineResponse. the macro generates all arms from a compact table of (Variant => method => Result) mappings
  • grouped entries by command category (string, ttl, list, hash, set, sorted set, vector, server) for readability

net change: ~-311 lines

what was tested

  • cargo build -p ember-server --features grpc,vector,protobuf — clean build
  • cargo test -p ember-server --features grpc,vector,protobuf — all 43 tests pass
  • clippy has pre-existing result_large_err warnings on validate_value and validate_key; no new warnings introduced

handle_pipeline_command had 57 identical match arms, each following
the same pattern: call svc method, wrap response in PipelineResponse.
replaced with a pipeline_dispatch! macro that generates all arms from
a table of (Variant => method => Result) mappings.

~400 lines → ~80 lines, grouped by command category with comments.
@kacy kacy merged commit 8a06c46 into main Feb 14, 2026
6 of 7 checks passed
@kacy kacy deleted the refactor/grpc-pipeline-macro branch February 14, 2026 22:21
kacy added a commit that referenced this pull request Feb 19, 2026
handle_pipeline_command had 57 identical match arms, each following
the same pattern: call svc method, wrap response in PipelineResponse.
replaced with a pipeline_dispatch! macro that generates all arms from
a table of (Variant => method => Result) mappings.

~400 lines → ~80 lines, grouped by command category with comments.
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