Skip to content

Commit

Permalink
Add initial stream commands to protobuf. (#998)
Browse files Browse the repository at this point in the history
Co-authored-by: nihohit <[email protected]>
  • Loading branch information
shachlanAmazon and nihohit authored Feb 22, 2024
1 parent c3f55e4 commit 44ef9a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions glide-core/src/protobuf/redis_request.proto
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ enum RequestType {
Strlen = 72;
Lindex = 73;
ZPopMax = 74;
XRead = 75;
XAdd = 76;
XReadGroup = 77;
XAck = 78;
XTrim = 79;
XGroupCreate = 80;
XGroupDestroy = 81;
}

message Command {
Expand Down
7 changes: 7 additions & 0 deletions glide-core/src/socket_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,13 @@ fn get_command(request: &Command) -> Option<Cmd> {
RequestType::Strlen => Some(cmd("STRLEN")),
RequestType::Lindex => Some(cmd("LINDEX")),
RequestType::ZPopMax => Some(cmd("ZPOPMAX")),
RequestType::XAck => Some(cmd("XACK")),
RequestType::XAdd => Some(cmd("XADD")),
RequestType::XReadGroup => Some(cmd("XREADGROUP")),
RequestType::XRead => Some(cmd("XREAD")),
RequestType::XGroupCreate => Some(get_two_word_command("XGROUP", "CREATE")),
RequestType::XGroupDestroy => Some(get_two_word_command("XGROUP", "DESTROY")),
RequestType::XTrim => Some(cmd("XTRIM")),
}
}

Expand Down

0 comments on commit 44ef9a9

Please sign in to comment.