Skip to content

Commit e4f267a

Browse files
authored
docs: 0.2.4
1 parent 8f5e9e5 commit e4f267a

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

README.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<br>
88

9-
![version 0.2.3](https://img.shields.io/badge/version-0.2.3-black?labelColor=black&style=flat-square) ![jdk 17](https://img.shields.io/badge/minimum_jdk-17-orange?labelColor=black&style=flat-square) ![load-test](https://img.shields.io/badge/load%20test%2010%2C000%2C000-success-brightgreen?labelColor=black&style=flat-square)
9+
![version 0.2.4](https://img.shields.io/badge/version-0.2.4-black?labelColor=black&style=flat-square) ![jdk 17](https://img.shields.io/badge/minimum_jdk-17-orange?labelColor=black&style=flat-square) ![load-test](https://img.shields.io/badge/load%20test%2010%2C000%2C000-success-brightgreen?labelColor=black&style=flat-square)
1010
![redis--stream](https://img.shields.io/badge/-redis--stream-da2020?style=flat-square&logo=Redis&logoColor=white)
1111

1212
Choreography 방식으로 구현된 분산 트랜잭션 라이브러리 입니다.
@@ -146,24 +146,29 @@ _롤백은 TransactionRollbackEvent로 전달되는 `undo` 필드를 사용합
146146
147147
```kotlin
148148

149-
@TransactionStartHandler
150-
fun handleTransactionStartEvent(event: TransactionStartEvent) {
151-
// ...
152-
}
149+
@TransactionHandler
150+
class TransactionHandler {
153151

154-
@TransactionJoinHandler
155-
fun handleTransactionJoinEvent(event: TransactionJoinEvent) {
156-
// ...
157-
}
152+
@TransactionStartListener(Foo::class) // Receive transaction event when event is Foo.class
153+
fun handleTransactionStartEvent(event: TransactionStartEvent) {
154+
val foo: Foo = event.decodeEvent(Foo::class) // Get event field to Foo.class
155+
// ...
156+
}
158157

159-
@TransactionCommitHandler
160-
fun handleTransactionCommitEvent(event: TransactionCommitEvent) {
161-
// ...
162-
}
158+
@TransactionJoinHandler // Receive all transaction event when no type is defined.
159+
fun handleTransactionJoinEvent(event: TransactionJoinEvent) {
160+
// ...
161+
}
162+
163+
@TransactionCommitHandler
164+
fun handleTransactionCommitEvent(event: TransactionCommitEvent): Mono<String> { // In Webflux framework, publisher must be returned.
165+
// ...
166+
}
163167

164-
@TransactionRollbackHandler
165-
fun handleTransactionRollbackEvent(event: TransactionRollbackEvent) {
166-
// ...
168+
@TransactionRollbackHandler
169+
fun handleTransactionRollbackEvent(event: TransactionRollbackEvent) { // In Mvc framework, publisher must not returned.
170+
val undo: Foo = event.decodeUndo(Foo::class) // Get event field to Foo.class
171+
}
167172
}
168173
```
169174

0 commit comments

Comments
 (0)