The current implementation of Scheduler does not allow tasks to be scheduled after the scheduler is started. Ideally, it could be run in a different thread and will continuously run new coroutines as they are added.
Design idea:
- Have a queue to represent coroutines pending scheduling
- Whenever a coroutine gives up execution, check if any additional coroutines need to be scheduled and add them to the active list if there are
The current implementation of
Schedulerdoes not allow tasks to be scheduled after the scheduler is started. Ideally, it could be run in a different thread and will continuously run new coroutines as they are added.Design idea: