diff options
author | Harkrishn Patro <30795839+hpatro@users.noreply.github.com> | 2022-01-03 01:54:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-02 16:54:47 -0800 |
commit | 9f8885760b53e6d3952b9c9b41f9e6c48dfa6cec (patch) | |
tree | 770dfdbff19a1a2a1c71a642ebd844d592ef3d26 /tests/support | |
parent | b8ba942ac2aabf51fd96134d9fa21b47d3baff4a (diff) | |
download | redis-9f8885760b53e6d3952b9c9b41f9e6c48dfa6cec.tar.gz |
Sharded pubsub implementation (#8621)
This commit implements a sharded pubsub implementation based off of shard channels.
Co-authored-by: Harkrishn Patro <harkrisp@amazon.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
Diffstat (limited to 'tests/support')
-rw-r--r-- | tests/support/cluster.tcl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/support/cluster.tcl b/tests/support/cluster.tcl index df4b7f3d0..081ef6a95 100644 --- a/tests/support/cluster.tcl +++ b/tests/support/cluster.tcl @@ -13,6 +13,7 @@ package require Tcl 8.5 package provide redis_cluster 0.1 namespace eval redis_cluster {} +set ::redis_cluster::internal_id 0 set ::redis_cluster::id 0 array set ::redis_cluster::startup_nodes {} array set ::redis_cluster::nodes {} @@ -32,7 +33,8 @@ set ::redis_cluster::plain_commands { hget hmset hmget hincrby hincrbyfloat hdel hlen hkeys hvals hgetall hexists hscan incrby decrby incrbyfloat getset move expire expireat pexpire pexpireat type ttl pttl persist restore - dump bitcount bitpos pfadd pfcount + dump bitcount bitpos pfadd pfcount cluster ssubscribe spublish + sunsubscribe } # Create a cluster client. The nodes are given as a list of host:port. The TLS @@ -118,6 +120,7 @@ proc ::redis_cluster::__method__refresh_nodes_map {id} { # Build this node description as an hash. set node [dict create \ id $nodeid \ + internal_id $id \ addr $addr \ host $host \ port $port \ @@ -265,6 +268,7 @@ proc ::redis_cluster::get_keys_from_command {cmd argv} { mget {return $argv} eval {return [lrange $argv 2 1+[lindex $argv 1]]} evalsha {return [lrange $argv 2 1+[lindex $argv 1]]} + spublish {return [list [lindex $argv 1]]} } # All the remaining commands are not handled. |