Skip to content

Commit

Permalink
@uhlmannm's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Sep 21, 2023
1 parent a68ea66 commit a939cf5
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions docs/recommendations.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sequenceDiagram
note right of server: outside sticky session
par
loop until successful lookup
server ->> server: look up recommendations on database
server ->> server: look up recommendations on database
end
and
AI -->>- task: return recommendations
Expand All @@ -36,7 +36,35 @@ sequenceDiagram
deactivate server
```

The lower half of the diagram could alternatively use a web socket:
Instead of "long polling" outside the sticky session, the client could also make repeated poll requests in the sticky session.
The lower half of the diagram then becomes:
```mermaid
sequenceDiagram
actor client as Fiori client
box ABAP
participant server as OData service
participant task as New task
end
participant AI as BTP recommendations service
activate server
activate task
task ->>+ AI: compute recommendations
par
loop until successful lookup
client ->> server: GET «Location header for recommendations»
server ->> server: look up recommendations on database
server -->> client: return recommendations if found
end
and
AI -->>- task: return recommendations
task ->> task: write recommendations to database
deactivate task
end
note over server: sticky session continues
deactivate server
```

Or the client could be notified via web socket when the recommendations are available:
```mermaid
sequenceDiagram
actor client as Fiori client
Expand All @@ -53,7 +81,7 @@ sequenceDiagram
task ->> client: send recommendation retrieval URL over web socket
deactivate task
client ->>+ server: GET «recommendation retrieval URL»
note right of server: outside sticky session
note right of server: outside or inside sticky session
server -->>- client: return recommendations
note over server: sticky session continues
deactivate server
Expand Down

0 comments on commit a939cf5

Please sign in to comment.