4 ms·
I think you could do something manageable with yield alone (at least with python-style generators). I've been meaning to try something like this with tornado.
by bdarnell 15y ago
I think you could do something manageable with yield alone (at least with python-style generators). I've been meaning to try something like this with tornado. The general idea is that yielding would either immediately produce a callback or asynchronously "wait" for a previously-generated callback to be run. It would look something like this:
doOneThing(yield Callback("key1"))
andAnother(yield Callback("key2"))
res1 = yield Wait("key1")
res2 = yield Wait("key2")