SUBSCRIBE
Listens for messages published to channels.
Browse all commands · Upstream source documentation
| Reference field | Value |
|---|---|
| Canonical name | SUBSCRIBE |
| Catalog group | Pub/Sub commands |
| Upstream since | 2.0.0 — upstream Redis/module version, not an ffkv release |
| Pinned catalog | Redis 8.10.0 |
Syntax
Section titled “Syntax”SUBSCRIBE channel [channel ...]ffkv behavior and limits
Section titled “ffkv behavior and limits”Pub/Sub is transient delivery, not durable leased jobs. Per client: 1,024 registrations, 8 MiB of names, 1,024-byte patterns, and 256 events/16 MiB of output. Overflow disconnects a slow subscriber; publications can fail the shared pattern-work budget.
Source: README.md:487–524; tests/bdd/features/pubsub.feature.
All requests share the 8 MiB framing/1,024-argument ingress limit; normal RESP replies have 64 MiB wire/logical budgets with bounded nesting/value counts. Management and Lua origins impose smaller budgets. These are not a process RSS cap. Catalog inclusion is not exhaustive option or wire-format parity. See limits and compatibility.
Upstream metadata
Section titled “Upstream metadata”The following fields come from the pinned Redis metadata, not measured ffkv performance or an assertion that ffkv enforces every upstream flag. Running COMMAND INFO/COMMAND DOCS describe the current engine.
Upstream Redis complexity: O(N) where N is the number of channels to subscribe to.
Upstream arity: -2 (includes the command name; a negative number is a minimum).
Command flags: PUBSUB, NOSCRIPT, LOADING, STALE, SENTINEL, DENYOOM.
Argument structure
Section titled “Argument structure”| Argument | Type | Constraints / metadata |
|---|---|---|
channel | string | multiple |
Additional pinned upstream metadata
{ "group": "pubsub", "since": "2.0.0", "history": []}Metadata source · Local snapshot: src/command_metadata.json, key subscribe.
BDD coverage and source examples
Section titled “BDD coverage and source examples”These are source observations, not a test run performed by this documentation build. A tag identifies scenario intent; an extracted vector identifies a command invocation, which may intentionally produce an error. Scenarios may require setup, multiple connections, persistence, cluster nodes or native-module fixtures.
- WRITE pause prevents delivery until the publisher is admitted (Scenario Outline) —
tests/bdd/features/client_control_repair.feature:176; invocation observed. - RESP2 redirects invalidations only to the requested persistent subscriber —
tests/bdd/features/connections.feature:495; invocation observed. - RESET clears subscriptions, database, names, protocol and tracking without closing the connection —
tests/bdd/features/connections.feature:686; invocation observed. - A regular subscription delivers payloads and unsubscribe removes the recipient —
tests/bdd/features/pubsub.feature:4; command tag and invocation observed. - Regular channel inspection applies glob filtering and counts exact subscribers —
tests/bdd/features/pubsub.feature:120; invocation observed. - Shard channels are disjoint from regular channels even when their names match —
tests/bdd/features/pubsub.feature:152; invocation observed. - RESP3 subscription pushes do not prevent ordinary commands on the same connection —
tests/bdd/features/pubsub.feature:230; command tag and invocation observed. - Real cluster peer links forward shard publications to replicas and global publications across shards —
tests/bdd/features/pubsub.feature:287; command tag and invocation observed.
Extracted command vectors
Section titled “Extracted command vectors”The following JSON arrays are the test harness’s argument vectors, not shell commands. Numeric arguments are converted by the harness; objects of the form {"base64":"…"} represent decoded binary bytes, not a literal JSON command argument. Preserve scenario setup and connection ordering. See the CLI guide for shell quoting and binary stdin. No reply is invented or inferred.
RESP3 subscription pushes do not prevent ordinary commands on the same connection — tests/bdd/features/pubsub.feature:233 (client “listener” sends:)
[ "SUBSCRIBE", "news"]Next source assertion: client “listener” receives:
{"type":"push","values":["subscribe","news",1]}A regular subscription delivers payloads and unsubscribe removes the recipient — tests/bdd/features/pubsub.feature:6 (client “listener” sends:)
[ "SUBSCRIBE", "orders"]Next source assertion: client “listener” receives:
["subscribe","orders",1]WRITE pause prevents delivery until the publisher is admitted — tests/bdd/features/client_control_repair.feature:178 (client “subscriber” sends:)
Expanded from an actual Examples row: subscribe=SUBSCRIBE, ack=subscribe, publish=PUBLISH, message=message.
[ "SUBSCRIBE", "paused-news"]Next source assertion: client “subscriber” receives:
["subscribe","paused-news",1]