Skip to content

feat: complete grpc api — pub/sub, slowlog, operational commands#141

Merged
kacy merged 2 commits intomainfrom
feat/grpc-complete-api
Feb 15, 2026
Merged

feat: complete grpc api — pub/sub, slowlog, operational commands#141
kacy merged 2 commits intomainfrom
feat/grpc-complete-api

Conversation

@kacy
Copy link
Copy Markdown
Owner

@kacy kacy commented Feb 15, 2026

summary

adds 15 new gRPC RPCs to bring the API closer to parity with RESP3:

unary commands:

  • Echo — string echo
  • Decr — decrement integer key
  • Unlink — async DEL with background deallocation
  • BgSave — trigger snapshot
  • BgRewriteAof — trigger AOF compaction
  • SlowLogGet, SlowLogLen, SlowLogReset — slowlog introspection
  • Publish — fire-and-forget publish to a channel
  • PubSubChannels, PubSubNumSub, PubSubNumPat — pub/sub introspection

streaming:

  • Subscribe — server-side streaming RPC. client sends channel/pattern lists, server streams SubscribeEvent messages. subscriptions are cleaned up automatically when the client disconnects.

all new unary commands are also available via the Pipeline bidirectional stream.

what was tested

  • cargo build -p ember-server --features grpc,vector — clean build
  • cargo test --workspace — all tests pass (69/69, one flaky echo test that passes on rerun)

design considerations

  • Subscribe uses server-side streaming rather than bidirectional streaming since the client only needs to send the initial subscription list. cleanup is handled via drop on client disconnect.
  • PubSubManager is now shared between RESP3 connection handlers and the gRPC service via Arc, so both protocols share the same pub/sub state.
  • cluster commands, protobuf storage, and blocking operations are intentionally deferred — they're either internal/operational or require more complex gRPC patterns.

kacy added 2 commits February 14, 2026 18:52
adds Echo, Decr, Unlink, BgSave, BgRewriteAof, SlowLog (get/len/reset),
Publish, Subscribe (server-streaming), PubSubChannels, PubSubNumSub,
PubSubNumPat to the EmberCache service definition.

includes corresponding message types and pipeline request/response
variants for all new unary commands.
implements Echo, Decr, Unlink, BgSave, BgRewriteAof, SlowLog
(get/len/reset), Publish, Subscribe (server-streaming), PubSubChannels,
PubSubNumSub, PubSubNumPat.

Subscribe uses server-side streaming — the client sends channel/pattern
lists and receives a stream of SubscribeEvent messages. cleanup runs
automatically when the client disconnects.

also passes PubSubManager to EmberService for pub/sub operations, and
adds all new unary commands to the pipeline dispatch macro.
@kacy kacy merged commit 18c3460 into main Feb 15, 2026
6 of 7 checks passed
@kacy kacy deleted the feat/grpc-complete-api branch February 15, 2026 00:11
kacy added a commit that referenced this pull request Feb 19, 2026
* feat: add new rpc definitions to proto

adds Echo, Decr, Unlink, BgSave, BgRewriteAof, SlowLog (get/len/reset),
Publish, Subscribe (server-streaming), PubSubChannels, PubSubNumSub,
PubSubNumPat to the EmberCache service definition.

includes corresponding message types and pipeline request/response
variants for all new unary commands.

* feat: implement new grpc rpc handlers

implements Echo, Decr, Unlink, BgSave, BgRewriteAof, SlowLog
(get/len/reset), Publish, Subscribe (server-streaming), PubSubChannels,
PubSubNumSub, PubSubNumPat.

Subscribe uses server-side streaming — the client sends channel/pattern
lists and receives a stream of SubscribeEvent messages. cleanup runs
automatically when the client disconnects.

also passes PubSubManager to EmberService for pub/sub operations, and
adds all new unary commands to the pipeline dispatch macro.
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