Skip to content

Commit

Permalink
[Docs] Add sequence diagrams to timeout strategy (#1699)
Browse files Browse the repository at this point in the history
* Add sequence diagrams to timeout strategy
  • Loading branch information
peter-csala authored Oct 16, 2023
1 parent bc4158f commit b169f88
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
Binary file added docs/media/timeout strategy happy path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/timeout strategy unhappy path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions docs/strategies/timeout.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,54 @@ HttpResponseMessage httpResponse = await pipeline.ExecuteAsync(
| `Timeout` | 30 seconds | The default timeout used by the strategy. |
| `TimeoutGenerator` | `null` | Generates the timeout for a given execution. |
| `OnTimeout` | `null` | Event that is raised when timeout occurs. |

## Diagrams

### Happy path sequence diagram

![Timeout strategy - happy path](../media/timeout%20strategy%20happy%20path.png)

<!-- ```mermaid
sequenceDiagram
actor C as Caller
participant P as Pipeline
participant T as Timeout
participant DM as DecoratedMethod
C->>P: Calls ExecuteAsync
P->>T: Calls ExecuteCore
T->>+DM: Invokes
DM->>DM: Performs <br/>long-running <br/>operation
DM->>-T: Returns result
T->>P: Returns result
P->>C: Returns result
``` -->

### Unhappy path sequence diagram

![Timeout strategy unhappy path](../media/timeout%20strategy%20unhappy%20path.png)

<!---
```mermaid
sequenceDiagram
actor C as Caller
participant P as Pipeline
participant T as Timeout
participant DM as DecoratedMethod
C->>P: Calls ExecuteAsync
P->>T: Calls ExecuteCore
T->>+DM: Invokes
activate T
activate DM
DM->>DM: Performs <br/>long-running <br/>operation
T->T: Times out
deactivate T
T->>DM: Propagates cancellation
deactivate DM
T->>P: Throws <br/>TimeoutRejectedException
P->>C: Propagates exception
```
-->

---

0 comments on commit b169f88

Please sign in to comment.