Single-worker background queue shared by editor domains. 更多...
#include <EditingTaskService.h>
Public 类型 | |
| using | Work = std::function< TaskOutcome(const TaskContext &)> |
Public 成员函数 | |
| TaskService () | |
| Start the editor background worker. | |
| ~TaskService () | |
| Cooperatively cancel pending work and join the worker. | |
| TaskService (const TaskService &)=delete | |
| TaskService & | operator= (const TaskService &)=delete |
| Result< TaskId > | submit (std::string name, Work work) |
| Queue background work and return its stable task identity. | |
| Result< void > | cancel (const TaskId &task) |
| Request cooperative cancellation of queued or running work. | |
| Result< void > | discard (const TaskId &task) |
| Cancel and release an owned task, including already finished tasks. @ownership Caller relinquishes its task id; queued captures are released immediately, running captures after work returns. @thread Thread-safe; worker callbacks never execute under the service lock. | |
| Result< TaskSnapshot > | snapshot (const TaskId &task) const |
| Return a thread-safe task snapshot. | |
| Result< void > | waitIdle (std::chrono::milliseconds timeout) |
| Wait until no task is queued or running; intended for shutdown and tests. | |
详细描述
Single-worker background queue shared by editor domains.
Worker functions receive only immutable captures. State publication is synchronized and can be queried from the host/UI thread without callbacks into game objects from the worker.
在文件 EditingTaskService.h 第 62 行定义.
成员类型定义说明
◆ Work
| using eve::editing::TaskService::Work = std::function<TaskOutcome(const TaskContext&)> |
在文件 EditingTaskService.h 第 64 行定义.
构造及析构函数说明
◆ TaskService() [1/2]
| eve::editing::TaskService::TaskService | ( | ) |
Start the editor background worker.
在文件 EditingTaskService.cpp 第 26 行定义.
◆ ~TaskService()
| eve::editing::TaskService::~TaskService | ( | ) |
Cooperatively cancel pending work and join the worker.
在文件 EditingTaskService.cpp 第 31 行定义.
◆ TaskService() [2/2]
|
delete |
成员函数说明
◆ cancel()
Request cooperative cancellation of queued or running work.
在文件 EditingTaskService.cpp 第 66 行定义.
引用了 eve::editing::Cancelled, eve::editing::Failed, found, eve::editing::Queued, record , 以及 eve::editing::Succeeded.
◆ discard()
Cancel and release an owned task, including already finished tasks. @ownership Caller relinquishes its task id; queued captures are released immediately, running captures after work returns. @thread Thread-safe; worker callbacks never execute under the service lock.
- 返回
- Applied, or NotFound for an unknown/already discarded id.
在文件 EditingTaskService.cpp 第 83 行定义.
引用了 found, record , 以及 eve::editing::Running.
被这些函数引用 eve::editor::AsyncPreview< Payload >::cancel() , 以及 eve::editor::AsyncPreview< Payload >::poll().
◆ operator=()
|
delete |
引用了 snapshot.
◆ snapshot()
| Result< TaskSnapshot > eve::editing::TaskService::snapshot | ( | const TaskId & | task | ) | const |
◆ submit()
Queue background work and return its stable task identity.
在文件 EditingTaskService.cpp 第 44 行定义.
被这些函数引用 eve::material_editing::MaterialEditorService::compileAsync() , 以及 eve::editor::AsyncPreview< Payload >::request().
◆ waitIdle()
| Result< void > eve::editing::TaskService::waitIdle | ( | std::chrono::milliseconds | timeout | ) |
Wait until no task is queued or running; intended for shutdown and tests.
在文件 EditingTaskService.cpp 第 114 行定义.
引用了 eve::Failed.
该类的文档由以下文件生成:
- src/modules/editing/EditingTaskService.h
- src/modules/editing/EditingTaskService.cpp