CLIENT UNBLOCK
Since 1.1.0Server
Syntax
CLIENT UNBLOCK id [TIMEOUT | ERROR]Ends the blocking command another connection is waiting in, such as BLPOP, BLMOVE, BZPOPMIN or XREAD BLOCK, as if its timeout had passed, or with an error. id is that connection's CLIENT ID.
TIMEOUT, the default: the blocked command returns what it returns on a timeout, usuallynil.ERROR: it fails with-UNBLOCKED client unblocked via CLIENT UNBLOCK.
Use it to stop a worker waiting on an empty queue, for example to shut it down, without closing its connection.
Reply
1 if the connection was blocked and has been released; 0 if there is no such connection or it was not blocked.
Examples
client 2> BLPOP jobs 0
client 1> CLIENT UNBLOCK 2
(integer) 1
client 2> (nil)
client 1> CLIENT UNBLOCK 2
(integer) 0
client 1> CLIENT UNBLOCK abc
(error) ERR value is not an integer or out of range