CLIENT PAUSE is a connections control command able to suspend all the Redis clients for the specified amount of time (in milliseconds).
CLIENT PAUSE 是连接控制命令，它可以将所有客户端的访问暂停给定的毫秒数
The command performs the following actions: 该命令执行如下：
- It stops processing all the pending commands from normal and pub/sub clients. However interactions with slaves will continue normally.
- However it returns OK to the caller ASAP, so the
CLIENT PAUSEcommand execution is not paused by itself.
- When the specified amount of time has elapsed, all the clients are unblocked: this will trigger the processing of all the commands accumulated in the query buffer of every client during the pause.
This command is useful as it makes able to switch clients from a Redis instance to another one in a controlled way. For example during an instance upgrade the system administrator could do the following: 当该命令可以可控的将客户端从一个Redis实例切换至另一个实例。比如，当需要升级一个实例时，管理员可以作如下操作：
- Pause the clients using
- Wait a few seconds to make sure the slaves processed the latest replication stream from the master.
- Turn one of the slaves into a master.
- Reconfigure clients to connect with the new master.
- 重配客户端以来接新的master 节点
It is possible to send
CLIENT PAUSE in a MULTI/EXEC block together with the
INFO replication command in order to get the current master offset
at the time the clients are blocked.
This way it is possible to wait for a specific offset in the slave side in order to make sure all the replication stream was processed.
CLIENT PAUSE 和
@simple-string-reply: The command returns OK or an error if the timeout is invalid. @simple-string-reply: 命令返回OK，超时设置无效则返回错误