transformId() should allow asynchronous computations
See original GitHub issueI use transformId()
to apply a cryptographic hash to the session id, which is very cpu-heavy and should be done asynchronously. It would be great if instead of the value itself transformId()
could also return a Promise with the generated value.
I have implemented this in my fork as https://github.com/nikwen/connect-mongo/commit/18f01604fad6e7509da20a8557a3b78464ef11ec, but the implementation uses async/await, so it would break compatibility for Node versions <8.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
When to Use (and Not to Use) Asynchronous Programming
Asynchronous programming is a form of parallel programming that allows a unit of work to run separately from the primary application thread.
Read more >9: Asynchronous Programming - Engineering LibreTexts
An asynchronous model allows multiple things to happen at the same time. When you start an action, your program continues to run. When...
Read more >You are not logged in. Reading 22: Promises
This reading discusses concurrent computation using promises. We start at the highest level, with the promise abstraction, and the await operator and async...
Read more >Asynchronous programming - C# | Microsoft Learn
The async keyword turns a method into an async method, which allows you to use the await keyword in its body.
Read more >Java CompletableFuture Tutorial with Examples - CalliCoder
Running asynchronous computation using runAsync() - ... You can use thenApply() method to process and transform the result of a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nikwen thanks for the update, however @mingchuno is the maintainer. I just commented on an issue that doesn’t apply to the
connect-mongo
session store, and is more suitably implemented using existing API methods inexpress
.@mingchuno no, not related. The uniqueness of the session id, coupled with the probability of a value being used more than once, is a separate issue than encryption of the session data.