Transaction participant that atomically applies one StatePatch batch. 更多...
#include <StatePatch.h>
Public 成员函数 | |
| StoreTransactionParticipant (Store &store, PatchBatch &batch) | |
| Bind one patch batch to a Store transaction. | |
| ~StoreTransactionParticipant () override=default | |
| Store transaction participant. | |
| std::string_view | name () const noexcept override |
| Stable participant name used in transaction diagnostics. | |
| eve::Result< void > | prepare (const transaction::TransactionContext &context) override |
| Validate and privately stage the batch. | |
| eve::Result< void > | commit (const transaction::TransactionContext &context) override |
| Publish the staged batch as one Store state swap. | |
| eve::Result< void > | rollback (const transaction::TransactionContext &context) override |
| Discard an unpublished candidate state. | |
| eve::Result< void > | compensate (const transaction::TransactionContext &context) override |
| Restore the state captured before this participant committed. | |
Public 成员函数 继承自 eve::transaction::ITransactionParticipant | |
| virtual | ~ITransactionParticipant ()=default |
| Releases ITransactionParticipant resources. | |
详细描述
Transaction participant that atomically applies one StatePatch batch.
The participant owns neither store nor batch; both are borrowed and must remain alive and unchanged by other writers until the coordinator finishes. prepare validates against a private complete-state candidate, commit swaps that candidate into the store, rollback discards it, and compensate swaps the pre-commit state back after a later participant has failed. Compensation is not a rollback: it is an explicit undo of an effect that was already made observable.
This class is synchronous and not thread-safe. It must be used on the same thread as its Store, and must not be retained for a later frame or task.
在文件 StatePatch.h 第 230 行定义.
构造及析构函数说明
◆ StoreTransactionParticipant()
|
inline |
Bind one patch batch to a Store transaction.
- 参数
-
store Borrowed authoritative Store to mutate on commit. batch Borrowed batch whose operations are staged and validated.
在文件 StatePatch.h 第 237 行定义.
◆ ~StoreTransactionParticipant()
|
overridedefault |
Store transaction participant.
成员函数说明
◆ commit()
|
overridevirtual |
Publish the staged batch as one Store state swap.
实现了 eve::transaction::ITransactionParticipant.
在文件 StatePatch.cpp 第 606 行定义.
引用了 eve::Applied, eve::Conflict, context, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::Status::success() , 以及 eve::Result< T >::success().
◆ compensate()
|
overridevirtual |
Restore the state captured before this participant committed.
实现了 eve::transaction::ITransactionParticipant.
在文件 StatePatch.cpp 第 628 行定义.
引用了 eve::Applied, eve::Conflict, context, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::Status::success() , 以及 eve::Result< T >::success().
◆ name()
|
inlineoverridevirtualnoexcept |
Stable participant name used in transaction diagnostics.
重载 eve::transaction::ITransactionParticipant .
在文件 StatePatch.h 第 242 行定义.
◆ prepare()
|
overridevirtual |
Validate and privately stage the batch.
实现了 eve::transaction::ITransactionParticipant.
在文件 StatePatch.cpp 第 578 行定义.
引用了 context, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::Result< T >::success().
◆ rollback()
|
overridevirtual |
Discard an unpublished candidate state.
实现了 eve::transaction::ITransactionParticipant.
在文件 StatePatch.cpp 第 618 行定义.
引用了 eve::Applied, context, eve::Status::success() , 以及 eve::Result< T >::success().
该类的文档由以下文件生成:
- src/modules/statepatch/StatePatch.h
- src/modules/statepatch/StatePatch.cpp
Public 成员函数 继承自