chore(pubsub): update api status (#189)

chore(pubsub): update api status.

Also make subcommand matching for pubsub case insensitive.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2022-07-04 20:15:27 +03:00 committed by GitHub
parent 55389d9be5
commit c174b3bead
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -147,8 +147,8 @@ with respect to Memcached and Redis APIs.
- [X] HSCAN
- [X] PubSub family
- [X] PUBLISH
- [ ] PUBSUB
- [ ] PUBSUB CHANNELS
- [X] PUBSUB
- [X] PUBSUB CHANNELS
- [X] SUBSCRIBE
- [X] UNSUBSCRIBE
- [X] PSUBSCRIBE

View File

@ -1054,7 +1054,9 @@ void Service::PubsubChannels(string_view pattern, ConnectionContext* cntx) {
}
void Service::PubsubPatterns(ConnectionContext* cntx) {
size_t pattern_count = shard_set->Await(0, [&] { return EngineShard::tlocal()->channel_slice().PatternCount(); });
size_t pattern_count =
shard_set->Await(0, [&] { return EngineShard::tlocal()->channel_slice().PatternCount(); });
(*cntx)->SendLong(pattern_count);
}
@ -1064,6 +1066,7 @@ void Service::Pubsub(CmdArgList args, ConnectionContext* cntx) {
return;
}
ToUpper(&args[1]);
string_view subcmd = ArgS(args, 1);
if (subcmd == "HELP") {
@ -1081,7 +1084,7 @@ void Service::Pubsub(CmdArgList args, ConnectionContext* cntx) {
}
if (subcmd == "CHANNELS") {
string pattern;
string_view pattern;
if (args.size() > 2) {
pattern = ArgS(args, 2);
}