Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Add sequence diagram to resilience context #1726

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/advanced/resilience-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,37 @@ public static class MyResilienceKeys
> [!NOTE]
> We recommend defining a static class to hold the resilience property keys used in your project. This approach makes these keys easier to discover and maintain. For simpler scenarios, you can directly use the creation of `ResiliencePropertyKey<string>` since it's a cheap, struct-based API.

### Sequence diagram

```mermaid
sequenceDiagram
autonumber
actor C as Caller
participant CP as ResilienceContextPool
participant P as Pipeline
participant R as Retry
participant D as DecoratedUserCallback
participant O as OnRetryUserCallback

C->>CP: Rents a context
CP->>C: Gives a context
C->>P: Calls ExecuteAsync<br/>with context
P->>R: Calls ExecuteCore<br/>with context
Note over R,D: Initial attempt
R->>+D: Invokes<br/>with context
D->>-R: Fails
R->>+O: Invokes<br/>with context
O->>-R: Completes
R-->>R: Sleeps
Note over R,D: 1st retry attempt
R->>+D: Invokes<br/>with context
D->>-R: Returns result
R->>P: Returns result
P->>C: Returns result
C-->>C: Accesses context
C->>CP: Returns the context
```

## Resilient context pooling

<!-- Overview -->
Expand Down