Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Question] Order Guarantees with the Async API #2900

Open
barshaul opened this issue Feb 19, 2025 · 2 comments
Open

[Question] Order Guarantees with the Async API #2900

barshaul opened this issue Feb 19, 2025 · 2 comments

Comments

@barshaul
Copy link

Hey,
I’m wondering if the following example guarantees execution order with node-redis async API:

await cluster.set('hello', 'cluster');
const value = await cluster.get('hello');

Does SET always execute before GET, even though SET wasn’t explicitly awaited?

Thanks!

@GalacticHypernova
Copy link

Your code awaits the set though, so it will always execute before the get

@barshaul
Copy link
Author

oops, I meant:

cluster.set('hello', 'cluster');
const value = await cluster.get('hello');

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants