Is it possible to do cooperative cancellation with just the standard lib? I know kotlinx.coroutines offers APIs for this. But I’m wondering if there’s basic support in the standard lib directly. I haven’t seen anything so far. I’m trying to avoid using kotlinx if possible due to JS bundle size concerns.
04/19/2020, 10:47 PM
no, the stdlib doesn't have any of the structured concurrency stuff, or any dispatchers, cancellation, etc. You can obviously rebuild it, but you're likely to make many more mistakes than using the kotlinx coroutines libs