2 ms·
Coroutines are for when you would normally use callbacks or a state machine, but handling the callback’s state or the state machine is complex enough that it be
by layer8 4y ago
Coroutines are for when you would normally use callbacks or a state machine, but handling the callback’s state or the state machine is complex enough that it becomes much simpler when expressed as a coroutine (simpler to reason about). It isn’t really an alternative to multithreading.