node-event-storage icon indicating copy to clipboard operation
node-event-storage copied to clipboard

Use async/await for proper async code

Open albe opened this issue 6 years ago • 1 comments

Since support for node 6.0 has been ruled out, this is doable without manual promisifying.

albe avatar Oct 07 '19 20:10 albe

Benchmarks with both promisified and fs.promise suggest being an order of magnitude slower than current sync calls. Of course those benchmarks are synthetic and in an actual application with a bit of CPU bound logic this will turn around. Still, the synchronous model has some benefits in this specific use case, where guarantees about order of writes and consistency are important.

Needs further investigation and playing around with use-cases.

albe avatar May 31 '20 23:05 albe