News for hackers. Stuff that matters.
Re:Async and Await by spriggan3 on Thursday June 02, 2016 @12:41PM (#11823947)
Why do you need mutexes in a single threaded context ? If you need sequential async operations that's what async await are for. What if you need to return something from someNetworkCall ? yes you're f..cked in that case.
Re:Async and Await by phpnode on Thursday June 02, 2016 @12:54PM (#11824066)
Presumably instances of `MyObject` can be accessed by functions which are running while this function is suspended, waiting for the network call. It's single threaded, as in only one thing happens at a time from JS's point of view, but other functions can be invoked (by a request coming in, or a UI event etc) while an asynchronous operation is awaiting completion.
Re:Async and Await by dvlsg on Thursday June 02, 2016 @12:56PM (#11824086)
That's not true. You could return (either the promise being used or a directly awaited value) and that value would be made available through await / promise as well.