5 ms·
Show HN: Async/await alternative
- maxpert 10y agoWell I hope NodeJS ultimately settles on such a syntax to preempt and resume automatically. I love Golang in this regard since it abstracts out everything using channels, and go-routines (not to compare multiple thread support).
- bbcbasic 10y agoLooked at the deasync that this is based on, and it looks like they are trying to reinvent threads? Seems ironic to me.
- vsviridov 10y agoNode 7 is out with async/await behind the flag.
- aaronhoffman 10y agoLove the simplicity. Wish it was powered by RxJS https://github.com/Reactive-Extensions/RxJS https://github.com/Reactive-Extensions/RxJS
- skybrian 10y agoIt's a nice trick but it's unsafe in general. JavaScript libraries usually assume single-threaded event handling. If you start up another event loop from a callback (while some other library's code is already on the stack), you'll probably break it.
- zamalek 10y ago// the stream has now been fully read, async in the background What if the file is gigabytes in size?
- bruno2223 10y agoThen you simply do not use this module :-) Unless you have Time and RAM to waste.