Skip to content

Commit

Permalink
Update state section to show eager state invocation
Browse files Browse the repository at this point in the history
This fixes #48.
  • Loading branch information
tillrohrmann committed Jun 30, 2023
1 parent cc2b2c5 commit 18f7602
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/tutorials/tour-of-restate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -769,17 +769,15 @@ Run the services and call the `addTicket` method, to see the interaction with st
[restate] [2023-06-26T08:49:43.631Z] DEBUG: [example.UserSessionService-AzEyMw==-0188f6e4fead7d35a9c880c4509699bf] [AddTicket] : Received completion message from Restate, adding to journal. ; CompletionMessage
//highlight-next-line
[restate] [2023-06-26T08:49:43.632Z] DEBUG: [example.UserSessionService-AzEyMw==-0188f6e4fead7d35a9c880c4509699bf] [AddTicket] : Adding message to journal and sending to Restate ; GetStateEntryMessage
[restate] [2023-06-26T08:49:43.632Z] DEBUG: [example.UserSessionService-AzEyMw==-0188f6e4fead7d35a9c880c4509699bf] [AddTicket] : Scheduling suspension in 30000 ms
[restate] [2023-06-26T08:49:43.633Z] DEBUG: [example.UserSessionService-AzEyMw==-0188f6e4fead7d35a9c880c4509699bf] [AddTicket] : Received completion message from Restate, adding to journal. ; CompletionMessage
//highlight-next-line
[restate] [2023-06-26T08:49:43.633Z] DEBUG: [example.UserSessionService-AzEyMw==-0188f6e4fead7d35a9c880c4509699bf] [AddTicket] : Adding message to journal and sending to Restate ; SetStateEntryMessage
... logs from expireTicket call ...
```

</details>

We see that when we request the state, the runtime sends us a completion back.
The completion contains the current state value.
We see that when we request the state, it gets logged in the journal.
The state value gets immediately retrieved, because the invocation state is eagerly sent.
Finally, we set the new value.

Add a log statement to print the cart contents, and then call `addTicket` multiple times to see how the state gets updated:
Expand Down

0 comments on commit 18f7602

Please sign in to comment.