Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add client pause/unpause docs #338

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/command-reference/server-management/client-pause.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
description: Learn how to use Redis CLIENT pause command to manage clients connected to the Redis server.
---

import PageTitle from '@site/src/components/PageTitle';

# CLIENT PAUSE

<PageTitle title="Redis CLIENT PAUSE (Documentation) | Dragonfly" />

## Syntax

CLIENT PAUSE timeout [WRITE | ALL]

**Time complexity:** O(1)
**ACL categories:** @admin, @slow, @dangerous, @connection

CLIENT PAUSE is a connections control command able to suspend all the Dragonfly clients for the specified amount of time (in milliseconds).

The command performs the following actions:

It stops processing all the pending commands from normal and pub/sub clients for the given mode. However interactions with replicas will continue normally. Note that clients are formally paused when they try to execute a command, so no work is taken on the server side for inactive clients.
However it returns `OK` to the caller as soon as possible, so the `CLIENT PAUSE` command 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.
Client pause currently supports two modes:

* ALL: This is the default mode. All client commands are blocked.
* WRITE: Clients are only blocked if they attempt to execute a write command.

## Return
Simple string reply: OK or an error if the timeout is invalid.
21 changes: 21 additions & 0 deletions docs/command-reference/server-management/client-unpause.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
description: Learn how to use Redis CLIENT unpause command to unblock paused clients.
---

import PageTitle from '@site/src/components/PageTitle';

# CLIENT UNPAUSE

<PageTitle title="Redis CLIENT UNPAUSE (Documentation) | Dragonfly" />

## Syntax

CLIENT UNPAUSE

**Time complexity:** O(N) Where N is the number of paused clients
**ACL categories:** @admin, @slow, @dangerous, @connection

CLIENT UNPAUSE is used to resume command processing for all clients that were paused by CLIENT PAUSE.

## Return
Simple string reply: OK.