A unit of work that has been handed to the BackgroundQueue.
More...
#include <BackgroundQueue.h>
|
| enum class | Priority { High
, Low
} |
| | The two priority levels the queue serves. High is always served first. More...
|
| |
|
|
void | RequestStop () |
| | Ask the task to stop at its next cancellation point. If it has not been started yet it is dropped from the queue, so a following Wait() returns at once. A task that is already running keeps running until it notices the request.
|
| |
|
void | Wait () |
| | Block until the task has finished (or was dropped before it started). Returns immediately if that already happened.
|
| |
|
bool | Pending () const |
| | Whether the task is still waiting in the queue or currently running.
|
| |
A unit of work that has been handed to the BackgroundQueue.
The submitter keeps a std::shared_ptr to it and uses it to wait for the work to finish (Wait()) or to request that it be cancelled (RequestStop()). It is the thread-pool equivalent of the jthread handle we used to store per Image.
◆ Priority
The two priority levels the queue serves. High is always served first.
| Enumerator |
|---|
| High | e.g.
loading an image: we need its size for the layout
|
| Low | e.g.
compressing the gnuplot source/data behind an image
|
The documentation for this class was generated from the following files: