Files
sablier/docs/strategies.md
Alexis Couvreur fbb6e38d53 docs: add multiversioned documentation (#344)
Documentation is now published on the `gh-pages` branch.

The branch will have a folder `docs` containing the following structure:
- `./docs` the copy from the `main` docs, but only used for the `index.html` page to do the multi-version routing.
- `./docs/main` the copy from the `main` branch docs folder
- `./docs/beta` the copy from the `beta` branch docs folder

Closes #332
2024-10-01 17:30:14 -07:00

64 lines
1.7 KiB
Markdown

# Strategies
## Dynamic Strategy
The **Dynamic Strategy** provides a waiting page for your session.
![Demo](assets/img/demo.gif)
?> This strategy is well suited for a user that would access a frontend directly and expects to see a loading page.
```plantuml
@startuml
User -> Proxy: Website Request
Proxy -> Sablier: Reverse Proxy Plugin Request Session Status
Sablier -> Provider: Request Instance Status
Sablier <-- Provider: Response Instance Status
Proxy <-- Sablier: Returns the X-Sablier-Status Header
alt `X-Sablier-Status` value is `not-ready`
User <-- Proxy: Serve the waiting page
loop until `X-Sablier-Status` value is `ready`
User -> Proxy: Self-Reload Waiting Page
Proxy -> Sablier: Reverse Proxy Plugin Request Session Status
Sablier -> Provider: Request Instance Status
Sablier <-- Provider: Response Instance Status
Proxy <-- Sablier: Returns the waiting page
User <-- Proxy: Serve the waiting page
end
end
User <-- Proxy: Content
@enduml
```
## Blocking Strategy
The **Blocking Strategy** hangs the request until your session is ready.
?> This strategy is well suited for an API communication.
```plantuml
@startuml
User -> Proxy: Website Request
Proxy -> Sablier: Reverse Proxy Plugin Request Session Status
Sablier -> Provider: Request Instance Status
alt `Instance` status is `not-ready`
Proxy -> Sablier: Reverse Proxy Plugin Request Session Status
Sablier -> Provider: Request Instance Status
Sablier <-- Provider: Response Instance Status
Proxy <-- Sablier: Returns the waiting page
end
Sablier <-- Provider: Response Instance Status
Proxy <-- Sablier: Response
User <-- Proxy: Content
@enduml
```