Skip to content

Commit

Permalink
Fix xread example for TypeScript
Browse files Browse the repository at this point in the history
Adresses redis#1871
  • Loading branch information
charlesritchea committed Mar 25, 2024
1 parent ec42c82 commit 453da85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ async function listenForMessage(lastId = "$") {
// `results` is an array, each element of which corresponds to a key.
// Because we only listen to one key (mystream) here, `results` only contains
// a single element. See more: https://redis.io/commands/xread#return-value
const results = await redis.xread("block", 0, "STREAMS", "mystream", lastId);
const results = await redis.xread("BLOCK", 0, "STREAMS", "mystream", lastId);
const [key, messages] = results[0]; // `key` equals to "mystream"

messages.forEach(processMessage);
Expand Down

0 comments on commit 453da85

Please sign in to comment.