Skip to content

Commit

Permalink
docs(README): show monitor.disconnect() async function example (#957)
Browse files Browse the repository at this point in the history
show monitor.disconnect() async function example
  • Loading branch information
knoxcard authored and luin committed Sep 7, 2019
1 parent a3c667d commit 6bd31e3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,15 @@ redis.monitor(function(err, monitor) {
monitor.on("monitor", function(time, args, source, database) {});
});
```

Here is another example illustrating an `async` function and `monitor.disconnect()`:
```javascript
async () => {
const monitor = await redis.monitor()
monitor.on('monitor', console.log)
// Any other tasks
monitor.disconnect()
}
```
## Streamify Scanning

Redis 2.8 added the `SCAN` command to incrementally iterate through the keys in the database. It's different from `KEYS` in that
Expand Down

0 comments on commit 6bd31e3

Please sign in to comment.