9 ms·
This is the direction JavaScript is going as well. Having used cancellation tokens in C#, I quite like the pattern. https://developer.mozilla.org/en-US/docs/We
by mikewhy 7y ago
This is the direction JavaScript is going as well. Having used cancellation tokens in C#, I quite like the pattern.
https://developer.mozilla.org/en-US/docs/Web/API/AbortController https://developer.mozilla.org/en-US/docs/Web/API/AbortContro...
- alpb 7y agoHow's it different than Go's context.Done() channel? Similarly it bubbles up everywhere the context is passed immediately, letting you terminate concurrent routines. I've used both .NET async/await (4 years ago) and Go ever since. The semantics and feel is nearly the same, the look is different.
- egeozcan 7y agoIMHO, being able to throw the error and it moving magically up the async stack (aka try/catch) makes it easier to get started while go makes it easier to maintain by forcing you to design a system around channels. This opinion is coming from a decade of .NET but just a few months of go experience so it's very skewed.