# CLIENT UNBLOCK

> End another connection's blocking command, as a timeout or with an error.

URL: https://docs.hotkv.com/commands/client-unblock/

```
CLIENT UNBLOCK client-id [TIMEOUT | ERROR]
```

- Group: Connection
- HotKV Cloud: all plans
- On-Premise: no license needed

`CLIENT UNBLOCK` ends a blocking command, such as [BLPOP](https://docs.hotkv.com/commands/blpop/index.md),
[BZPOPMIN](https://docs.hotkv.com/commands/bzpopmin/index.md) or [XREAD](https://docs.hotkv.com/commands/xread/index.md) with `BLOCK`,
that another connection is waiting in. Use it to wake a worker that you want
to stop or reconfigure without waiting for its timeout.

## Options

| Option | Effect |
| --- | --- |
| `client-id` | The id of the blocked connection, see [CLIENT ID](https://docs.hotkv.com/commands/client-id/index.md). |
| `TIMEOUT` | The blocked command returns as if its timeout had expired. This is the default. |
| `ERROR` | The blocked command fails with `UNBLOCKED client unblocked via CLIENT UNBLOCK`. |

## Return value

| Case | Reply (RESP2 and RESP3) |
| --- | --- |
| The connection was blocked and is now unblocked | Integer `1` |
| No such connection, or it is not blocked | Integer `0` |
| `client-id` is not an integer | Error `ERR value is not an integer or out of range` |
| Reason is not `TIMEOUT` or `ERROR` | Error `ERR CLIENT UNBLOCK reason should be TIMEOUT or ERROR` |

## Examples

In one connection:

```
127.0.0.1:6379> CLIENT ID
(integer) 21
127.0.0.1:6379> BLPOP jobs 0
```

In another:

```
127.0.0.1:6379> CLIENT UNBLOCK 21 ERROR
(integer) 1
```

The first connection then gets:

```
(error) UNBLOCKED client unblocked via CLIENT UNBLOCK
```

## Compatibility

Same as Redis 7 and Valkey 8.

## See also

[CLIENT ID](https://docs.hotkv.com/commands/client-id/index.md), [CLIENT KILL](https://docs.hotkv.com/commands/client-kill/index.md),
[BLPOP](https://docs.hotkv.com/commands/blpop/index.md), [blocking operations](https://docs.hotkv.com/develop/blocking-operations/index.md)