-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
api-changeIssues or PRs related to api changesIssues or PRs related to api changeskind/discussionFor further discussionFor further discussionkind/featureCategory issues or prs related to feature request.Category issues or prs related to feature request.
Milestone
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:
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
):
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.
Metadata
Metadata
Assignees
Labels
api-changeIssues or PRs related to api changesIssues or PRs related to api changeskind/discussionFor further discussionFor further discussionkind/featureCategory issues or prs related to feature request.Category issues or prs related to feature request.