Class to support running a background task.
More...
#include <Task.h>
|
| virtual void | loop ()=0 |
| | Inherited classes override this to perform actual work. More...
|
| |
| virtual void | onNotify ([[maybe_unused]] Notify code) |
| | Called immediately before calling to loop() to indicate a state change. More...
|
| |
Class to support running a background task.
- Note
- A task is implemented by overriding the
loop() method to perform some work. All tasks must co-operate to ensure the system runs smoothly. Note that there is no yield() function to call. All tasks share the same stack space.
◆ Notify
Notification of state change.
| Enumerator |
|---|
| None | |
| Suspending | |
| Resuming | |
| Sleeping | |
| Waking | |
◆ State
State of a task.
| Enumerator |
|---|
| Suspended | |
| Sleeping | |
| Running | |
◆ ~Task()
◆ loop()
| virtual void Task::loop |
( |
| ) |
|
|
protectedpure virtual |
Inherited classes override this to perform actual work.
Implemented in Jerryscript::Task.
◆ onNotify()
| virtual void Task::onNotify |
( |
[[maybe_unused] ] Notify |
code | ) |
|
|
inlineprotectedvirtual |
Called immediately before calling to loop() to indicate a state change.
◆ resume()
Call to set task running.
- Return values
-
| bool | true on success, false if task queue is full |
◆ sleep()
Puts the task to sleep for a while.
- Parameters
-
| interval | Time in milliseconds |
◆ suspend()
The documentation for this class was generated from the following file: