Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

disconnect in basic example #2235

Merged
merged 1 commit into from Oct 31, 2022
Merged

disconnect in basic example #2235

merged 1 commit into from Oct 31, 2022

Conversation

reviewher
Copy link
Contributor

Description

The basic example just hangs. It was missing the disconnect.


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

@leibale
Copy link
Collaborator

leibale commented Aug 22, 2022

I'm pretty sure that most of the node apps are REST APIs, and in that scenario you don't want to .disconnect()/.quit()

@simonprickett @guyroyse WDUT?

@reviewher
Copy link
Contributor Author

It's a "basic example" and listed as the first example in the README. There are no instructions for how to run it.

"Obviously" you start a local server and copy-paste the example to a MJS file and run it with node. Try it. The process will just hang.

The documentation can include a note about when disconnect/quit are appropriate.

@leibale
Copy link
Collaborator

leibale commented Aug 22, 2022

Maybe we should leave the example as is and add a note with a link to this section

@reviewher
Copy link
Contributor Author

If it is the case that "most of the node apps are REST APIs", then the "basic example" should be a simple REST server using raw Node HTTP server or ExpressJS.

The idea of a "basic example" IMHO is something you can run. A person who is new to node-redis will see the snippet with an actual import statement etc. and just test it out, wondering why the process is stuck.

@simonprickett
Copy link
Contributor

I like the idea of having it in there?

@leibale leibale merged commit 64f86d6 into redis:master Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants