Typed latest-request preview publication using the existing editing task executor. @ownership Worker owns immutable input captures and a private completion mailbox, never a domain pointer. @thread All methods are owner-thread only. Work runs on TaskService's worker and must cooperate with cancellation. @reentrancy No work or unknown callback executes under a publication lock. @lifetime Close invalidates publication immediately; destruction cancels and joins bounded/cooperative work. 更多...
#include <AsyncPreview.h>
Public 类型 | |
| using | Work = std::function< editing::Result< Payload >(const editing::TaskContext &)> |
Public 成员函数 | |
| AsyncPreview ()=default | |
| Start a private task executor; no domain state is captured. | |
| ~AsyncPreview () | |
| Cancel outstanding work before the executor joins. | |
| AsyncPreview (const AsyncPreview &)=delete | |
| AsyncPreview & | operator= (const AsyncPreview &)=delete |
| editing::Result< void > | request (Work work) |
| Queue owning work, cancelling the previous request. Returns Pending after acceptance. @cost Queues one background computation; capture size is paid once per invalidation, not per poll. | |
| std::optional< editing::Result< Payload > > | poll () |
| Consume only the current request's completion, once; failed providers preserve the domain payload. | |
| editing::Result< void > | cancel () |
| Cancel queued/running work and discard any completed but unpublished result; keeps the last domain preview. | |
| editing::Result< void > | replaceProvider (bool available) |
| Invalidate all old provider work, including replacement with the same provider instance or absence. | |
| void | close () |
| Permanently close this session; cancellation is observable immediately and closure is idempotent. | |
| void | rejectPublication () noexcept |
| Record a domain validation failure after consuming a provider result; the domain keeps its previous payload. | |
| PreviewState | state () const noexcept |
| Read lifecycle state without copying the domain payload or querying any registry. | |
详细描述
class eve::editor::AsyncPreview< Payload >
Typed latest-request preview publication using the existing editing task executor. @ownership Worker owns immutable input captures and a private completion mailbox, never a domain pointer. @thread All methods are owner-thread only. Work runs on TaskService's worker and must cooperate with cancellation. @reentrancy No work or unknown callback executes under a publication lock. @lifetime Close invalidates publication immediately; destruction cancels and joins bounded/cooperative work.
在文件 AsyncPreview.h 第 22 行定义.
成员类型定义说明
◆ Work
| using eve::editor::AsyncPreview< Payload >::Work = std::function<editing::Result<Payload>(const editing::TaskContext&)> |
在文件 AsyncPreview.h 第 24 行定义.
构造及析构函数说明
◆ AsyncPreview() [1/2]
|
default |
Start a private task executor; no domain state is captured.
◆ ~AsyncPreview()
|
inline |
Cancel outstanding work before the executor joins.
在文件 AsyncPreview.h 第 28 行定义.
◆ AsyncPreview() [2/2]
|
delete |
成员函数说明
◆ cancel()
|
inline |
Cancel queued/running work and discard any completed but unpublished result; keeps the last domain preview.
在文件 AsyncPreview.h 第 101 行定义.
引用了 eve::editor::Cancelled, eve::editor::Closed, eve::editing::TaskService::discard(), eve::UuidIdAdapter< Tag >::empty(), eve::editor::PreviewState::phase , 以及 eve::editor::Unavailable.
被这些函数引用 eve::editor::AsyncPreview< Payload >::close(), eve::editor::AsyncPreview< Payload >::replaceProvider() , 以及 eve::editor::AsyncPreview< Payload >::request().
◆ close()
|
inline |
Permanently close this session; cancellation is observable immediately and closure is idempotent.
在文件 AsyncPreview.h 第 125 行定义.
引用了 eve::editor::AsyncPreview< Payload >::cancel(), cancelled, eve::editor::Closed, EV_ASSERT , 以及 eve::editor::PreviewState::phase.
被这些函数引用 eve::editor::AsyncPreview< Payload >::~AsyncPreview().
◆ operator=()
|
delete |
◆ poll()
|
inline |
Consume only the current request's completion, once; failed providers preserve the domain payload.
在文件 AsyncPreview.h 第 84 行定义.
引用了 eve::editing::TaskService::discard(), eve::editor::Failed, eve::Result< T >::failure(), eve::editor::PreviewState::phase, eve::editor::Ready , 以及 result.
◆ rejectPublication()
|
inlinenoexcept |
Record a domain validation failure after consuming a provider result; the domain keeps its previous payload.
在文件 AsyncPreview.h 第 132 行定义.
引用了 eve::editor::Failed , 以及 eve::editor::PreviewState::phase.
◆ replaceProvider()
|
inline |
Invalidate all old provider work, including replacement with the same provider instance or absence.
在文件 AsyncPreview.h 第 113 行定义.
引用了 eve::editor::AsyncPreview< Payload >::cancel(), cancelled, eve::editor::Closed, eve::editor::Idle, eve::editor::PreviewState::phase, eve::editor::PreviewState::providerGeneration , 以及 eve::editor::Unavailable.
◆ request()
|
inline |
Queue owning work, cancelling the previous request. Returns Pending after acceptance. @cost Queues one background computation; capture size is paid once per invalidation, not per poll.
在文件 AsyncPreview.h 第 36 行定义.
引用了 eve::editor::AsyncPreview< Payload >::cancel(), cancelled, eve::editor::Closed, context, eve::editing::TaskOutcome::diagnostics, error, eve::editor::Failed, eve::Result< T >::failure(), eve::editing::pending(), eve::editor::Pending, eve::editor::PreviewState::phase, eve::editor::PreviewState::request, result, eve::editing::TaskOutcome::status, eve::editing::TaskService::submit() , 以及 eve::editor::Unavailable.
◆ state()
|
inlinenoexcept |
Read lifecycle state without copying the domain payload or querying any registry.
在文件 AsyncPreview.h 第 134 行定义.
该类的文档由以下文件生成:
- src/modules/editor/presentation/AsyncPreview.h