apache / apache/incubator-seata

[feature] Hoping that `reduce` and `compensate` methods in Saga can support RxJava Observable/CompleteableFuture/Kotlin suspend functions

Open
#2,556 1 comment 0 reactions 1 assignee Claimed by @long187 View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.