[API-CHANGE] Bring nouveau Sentinel entry API in Sentinel 2.0 | Sentinel 2.0 全新 API model
- Dominant language
- Java
- Stars
- 23.1k
- Forks
- 8.1k
- PR merge metrics
- No merged PRs in 30d
Description
## Issue Description
Type: *feature request*
### Describe what happened (or what feature you want)
There are some drawbacks to *legacy Sentinel API model*:
- Strategies during invocation (e.g. timeout cut-down, retry, bulkhead isolation) cannot be carried out due to the restriction of the API model (for the lack of "managed" model).
- Lacking capabilities of traffic scheduling (i.e. routing and load balancing).

So we'd like to propose a nouveau Sentinel entry API in Sentinel 2.0.

An example of "managed" model:
```java
try {
// f (() -> R): your actual logic, wrapped with lamada
// fallbackSupplier (() -> R): generates the fallback object when fails
R result = Sentinel.execute(resourceName, f, fallbackSupplier, args);
} catch (BlockException e) {
// your block handler here
}
```
An example of "outside-wrapped" model (like legacy `entry`):
```java
try (Sentinel.entry(resourceName)) {
// your logic here
} catch (BlockException e) {
// your block handler here
}
```
NOTE: The legacy `SphU` and `SphO` API will not be deprecated, but we'll recommend using the new API for Sentinel 2.0.
Contributor guide
Assessment
This issue has not been assessed yet.