Skip to content

Add example script showing how to perform a blocking pop from a list. #1693

@simonprickett

Description

@simonprickett

Add an example script that shows how to use the BLPOP command to block indefinitely until an element is pushed to a list, then returns that element and displays it with console.log.

Use the LPUSH command to push an element into the list, which should unblock your BLPOP call.

For this, you'll need to use the "isolated" option, see the documentation in the README here - this describes the scenario you'll need to implement when making this example.

Name your file blocking-list-pop.js (or .ts if you prefer TypeScript. Name the function containing your code blockingListPop and please pay attention to the guidelines for adding an example to ensure that your contribution can be merged.

This is part of our participation in Hacktoberfest 2021. Learn how to complete this issue here: https://developer.redis.com/hacktoberfest/

Need help or want to talk to us? Join us on Discord where we have a dedicated Hacktoberfest channel: https://discord.gg/ueQwKUh5Z3

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions