diff --git a/docs/get_started/tour.mdx b/docs/get_started/tour.mdx index 43039848..cf578be0 100644 --- a/docs/get_started/tour.mdx +++ b/docs/get_started/tour.mdx @@ -1032,6 +1032,7 @@ You will fix this later on. Note that the `CheckoutService` is not a Virtual Obj 2024/08/16 13:41:03 INFO Invocation completed successfully method=CartObject/Checkout invocationID=inv_1fmRNvSNVxNp3lG8MTJNCop4OwmqZXVRi9 ``` ``` + Make the `CartObject/checkout` handler call the `CheckoutService/handle` handler. @@ -1050,8 +1051,7 @@ You will fix this later on. Note that the `CheckoutService` is not a Virtual Obj Call `CartObject/checkout` as you did [earlier](#request-response-calls-over-http) and have a look at the Restate Server logs again to see what happened: - - + ## Durable Execution @@ -2035,50 +2035,6 @@ Try to reserve the same ticket ID multiple times, and see how you are able to re Set the `"status"` to `TicketStatus.Sold` if it's reserved. -
-Solution -```ts ticket_object.ts -CODE_LOAD::https://raw.githubusercontent.com/restatedev/examples/main/tutorials/tour-of-restate-typescript/src/part3/ticket_object.ts#mark_as_sold -``` -In the next section, you implement the `CheckoutService/handle` function that calls `markAsSold`. -This ties the final parts together. -
-
- - - -1. Retrieve the value for the `"status"` state key. -2. If the value is set to `TicketStatus.Available`, then change it to `TicketStatus.Reserved` and -return `true` (reservation successful). -3. If the status isn't set to `TicketStatus.Available`, then return `false`. - -
-Solution -```java TicketObject.java -CODE_LOAD::https://raw.githubusercontent.com/restatedev/examples/main/tutorials/tour-of-restate-java/src/main/java/dev/restate/tour/part3/TicketObject.java#reserve -``` - -Now, you can't reserve the same ticket multiple times anymore. -Call `addTicket` multiple times for the same ID. The first time it returns `true`, afterwards `false`. -
-
- -Clear the `"status"`, if it's not equal to `TicketStatus.Sold`. -
-Solution -```java TicketObject.java -CODE_LOAD::https://raw.githubusercontent.com/restatedev/examples/main/tutorials/tour-of-restate-java/src/main/java/dev/restate/tour/part3/TicketObject.java#unreserve -``` - -Now, the ticket reservation status is cleared when the delayed `expireTicket` call triggers. -Play around with reducing the delay of the `expireTicket` call in the `addTicket` handler. -Try to reserve the same ticket ID multiple times, and see how you are able to reserve it again after the `unreserve` handler executed. - -
-
- -Set the `"status"` to `TicketStatus.Sold` if it's reserved. -
Solution ```java TicketObject.java