apache / apache/incubator-seata
[feature] Hoping that `reduce` and `compensate` methods in Saga can support RxJava Observable/CompleteableFuture/Kotlin suspend functions
- Dominant language
- Java
- Stars
- 26k
- Forks
- 8.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 4
Description
## Why you need it?
In Vertx or Spring Reacvice Database, reactive framework like RxJava or Reactor are wildly used. So hoping that Saga can support Reactive Programming
## The expected result
When define a saga action, I can use the following syntex:
```java
public interface InventoryAction {
// RxJava
Single reduce(String businessKey, int count);
// Java CompleteableFuture
CompleteableFuture compensateReduce(String businessKey);
}
```
or
```kotlin
interface InventoryAction {
// Kotlin coroutine, which can be mapped into RxJava or Java CompleteableFuture so it is not the primary goal
suspend fun reduce(val foo: String, val bar: Int): Boolean
}
```
Contributor guide
Assessment
This issue has not been assessed yet.