From c34aad6fc7f8815a134efde8f7ad59e8aa0c3fb6 Mon Sep 17 00:00:00 2001 From: Alexey Zorkaltsev Date: Mon, 9 Sep 2024 11:19:19 +0300 Subject: [PATCH] chore: add diagrams --- src/topic/README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/topic/README.md b/src/topic/README.md index 5876c88f..a9d7b43f 100644 --- a/src/topic/README.md +++ b/src/topic/README.md @@ -14,3 +14,37 @@ Notice: This API is EXPERIMENTAL and may be changed or removed in a later releas - Transactions - Add context - Graceful shutdown + +# State machine + +## Stream + +```mermaid +stateDiagram +direction LR +[*] --> Init +Init --> Active +Active --> Closing +Closing --> Closed +Active --> Closed +Closed --> [*] +``` + +## Retryer + +```mermaid +stateDiagram +direction TB +[*] --> init +init --> initStream +initStream --> active +active --> retriableError +active --> notRetriableError +active --> closing +closing --> closed +retriableError --> reinitStream +reinitStream --> forceblyCloseExistingStream +forceblyCloseExistingStream --> initStream +notRetriableError --> [*] +note right of notRetriableError : one of the possible causes of the error is the context timeout
+```