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

Can Node.js keep state? #69

Closed
cheerfulstoic opened this issue Jul 26, 2021 · 1 comment
Closed

Can Node.js keep state? #69

cheerfulstoic opened this issue Jul 26, 2021 · 1 comment

Comments

@cheerfulstoic
Copy link

So this library keeps a set of workers in a pool to interface with Node.js. If I want to execute some Node.js code, is it possible to have an ongoing session or state? That is, if I make the same function call more than once I might get a different result back the second or third time? And, if so, would I need to have a "sticky session" with the user to make sure I get the same ongoing state?

I could write some JS code to store things or disk or in a DB and I might just do that, but I wanted to check first what this library is capable of. Thanks! 😊

@cheerfulstoic
Copy link
Author

Ah ha! I found this comment which mentions setting NODE_ENV=production, and that has suddenly given me state! If I start up different iex -S mix sessions I get different state, which is interesting, and I'd love to understand that, but it's working how I'd like, so I'm happy for now! 😁 Thanks!

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

No branches or pull requests

1 participant