Open unixpickle opened 10 years ago
This looks very similar to Node domains feature (which I think adds too much complexity). With promises it's possible to .catch()
all errors at the end of async chain.
This reminds me to how co, genrun and other generators-based coroutines libraries works with promises. It could be added to runtime.js, but I believe using that libraries it's enought. El 04/09/2014 17:15, "Alex Nichol" notifications@github.com escribió:
Dart introduced the idea of zones for catching exceptions through an asynchronous callback chain. You can read about that at https://www.dartlang.org/articles/zones/.
Runtime could employ something similar, since it employs futures and promises to wrap asynchronous callbacks.
— Reply to this email directly or view it on GitHub https://github.com/runtimejs/runtime/issues/28.
Yeah, according to this benchmark https://github.com/petkaantonov/bluebird/blob/master/benchmark/stats/latest.md generators could be even faster than callbacks and consume less memory.
pulling in @othiym23 who has an opinion or two on the topic of domains, zones, and side-channel state in asynchronous execution stacks
@iefserge Zones allow more than catching exceptions on a single asynchronous callback chain. You can use zones and child-zones to catch errors on more than one callback chain, or on a part of a callback chain.
Additionally, you can use Zones to override various methods (in Dart, print
is the only such method, but I think that's an under-utilization of what could be).
Dart introduced the idea of zones for catching exceptions through an asynchronous callback chain. You can read about that at https://www.dartlang.org/articles/zones/.
Runtime could employ something similar, since it employs futures and promises to wrap asynchronous callbacks.