Skip to content

[API-CHANGE] Bring nouveau Sentinel entry API in Sentinel 2.0 | Sentinel 2.0 全新 API model #2845

@sczyh30

Description

@sczyh30

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).

image

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

image

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 changeskind/discussionFor further discussionkind/featureCategory issues or prs related to feature request.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions