Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/r2d2/mod.ts>listenReplies

Lightweight Redis client library for Deno.
Go to Latest
function listenReplies
import { listenReplies } from "https://deno.land/x/r2d2@v0.0.10/mod.ts";

Used for pub/sub. Listens for replies from the Redis server.

Example:

await writeCommand(redisConn, ["SUBSCRIBE", "mychannel"]);

for await (const reply of listenReplies(redisConn)) {
  // Prints ["subscribe", "mychannel", 1] first iteration
  console.log(reply);
}

Returns

AsyncIterable<Reply>