question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

transformId() should allow asynchronous computations

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
jas-commented, Apr 19, 2019

@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 in express.

1reaction
jas-commented, Apr 15, 2019

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found