This file contains classes to run cooperatively scheduled tasks in a multitasking system. More...
Classes | |
class | cotask.Task |
This class implements behavior common to tasks in a cooperative multitasking system which runs in MicroPython. More... | |
class | cotask.TaskList |
This class holds the list of tasks which will be run by the task scheduler. More... | |
Variables | |
cotask.task_list = TaskList () | |
This is the main task list which is created for scheduling when cotask.py is imported into a program. | |
This file contains classes to run cooperatively scheduled tasks in a multitasking system.
Tasks are created as descendents of class
CoTask
, with the user overriding the run()
method of CoTask
and the ready()
method if appropriate. References to all the tasks to be run in the system are kept in a list maintained by class CoTaskList
; the system scheduler then runs the tasks' run()
methods according to a chosen scheduling algorithm such as round-robin or highest-priority-first.