This change makes the MessageQueue use Tasks for sending a Message to each MessageListener. Messages can define their behavior by setting setSendAsTask(), the default is true. Only MessageStatus and MessageInterruptTasks are still sent on the Messaging thread to allow for immediate effect. This change also introduced the class SimpleTask which holds only a single perform() callback to override, for Tasks that are finished in a single step. The class LambdaTask derives from SimpleTask and allows for passing a lambda as the perform() callback.
29 lines
256 B
C++
29 lines
256 B
C++
#include "utility/scheduling/SimpleTask.h"
|
|
|
|
void SimpleTask::enter()
|
|
{
|
|
|
|
}
|
|
|
|
Task::TaskState SimpleTask::update()
|
|
{
|
|
perform();
|
|
|
|
return Task::STATE_FINISHED;
|
|
}
|
|
|
|
void SimpleTask::exit()
|
|
{
|
|
|
|
}
|
|
|
|
void SimpleTask::interrupt()
|
|
{
|
|
|
|
}
|
|
|
|
void SimpleTask::revert()
|
|
{
|
|
|
|
}
|