Interesting idea! You’ve done a great job on documentation. I’ve been thinking about cancellation recently and missing Golang’s Context type, so it’s cool to see some other approaches.
How does Typescript deal with replacing `await XXX` with `yield YYY`? Can typescript infer the type of the yield expression?
How cancellable are these flows, really? My issue with most libraries that promise (no pun intended) cancellation in Node is that at the bottom of the call stack is someone else’s callback code where cancellation is impossible - cancellation is always “cooperative”. So, other than avoiding a tick - couldn’t you get the same sort of features by wrapping all your `await` calls with a special `await ctx.checkpoint(someAsyncOperation())` that throws CancellationError?
2 comments
[ 5.7 ms ] story [ 15.4 ms ] threadHow does Typescript deal with replacing `await XXX` with `yield YYY`? Can typescript infer the type of the yield expression?
How cancellable are these flows, really? My issue with most libraries that promise (no pun intended) cancellation in Node is that at the bottom of the call stack is someone else’s callback code where cancellation is impossible - cancellation is always “cooperative”. So, other than avoiding a tick - couldn’t you get the same sort of features by wrapping all your `await` calls with a special `await ctx.checkpoint(someAsyncOperation())` that throws CancellationError?
BumbleCoroutines - it makes writing games fun.
Here’s a game I made that uses Bumble and it’s coroutine system: https://github.com/jbluepolarbear/Bumble-Asteroids