@@ -21,6 +21,7 @@ Common tasks and patterns implemented with Restate:
21
21
- ** [ Event Enrichment / Joins] ( README.md#event-enrichment--joins ) ** : Stateful functions/actors connected to Kafka and callable over RPC. [ <img src =" https://raw.githubusercontent.com/restatedev/img/refs/heads/main/play-button.svg " width =" 16 " height =" 16 " >] ( src/eventenrichment/packagetracker.go )
22
22
23
23
## Durable RPC, Idempotency and Concurrency
24
+ [ <img src =" https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg " >] ( src/durablerpc/client/client.go )
24
25
25
26
This example shows:
26
27
- ** Durable RPC** : once a request has reached Restate, it is guaranteed to be processed
@@ -59,6 +60,7 @@ Restate deduplicated the request (with the reservation ID as idempotency key) an
59
60
</details >
60
61
61
62
## (Delayed) Message Queue
63
+ [ <img src =" https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg " >] ( src/queue/client/tasksubmitter.go )
62
64
63
65
Use Restate as a queue. Schedule tasks for now or later and ensure the task is only executed once.
64
66
@@ -69,6 +71,7 @@ Use Restate as a queue. Schedule tasks for now or later and ensure the task is o
69
71
- [ Async Task Worker] ( src/queue/service/asynctaskworker.go ) : gets invoked by Restate for each task in the queue.
70
72
71
73
## Webhook Callbacks
74
+ [ <img src =" https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg " >] ( src/webhookcallbacks/callbackrouter.go )
72
75
73
76
This example processes webhook callbacks from a payment provider.
74
77
@@ -77,17 +80,8 @@ This turns handlers into durable event processors that ensure the event is proce
77
80
78
81
You don't need to do anything special!
79
82
80
- ## Scheduling Tasks
81
- This example processes failed payment events from a payment provider.
82
- The service reminds the customer for 3 days to update their payment details, and otherwise escalates to support.
83
-
84
- To schedule the reminders, the handler uses Restate's durable timers and delayed calls.
85
- The handler calls itself three times in a row after a delay of one day, and then stops the loop and calls another handler.
86
-
87
- Restate tracks the timer across failures, and triggers execution.
88
-
89
-
90
83
## Convert Sync Tasks to Async
84
+ [ <img src =" https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg " >] ( src/dataupload/client/client.go )
91
85
92
86
This example shows how to use the Restate SDK to ** kick of a synchronous task and turn it into an asynchronous one if it takes too long** .
93
87
@@ -114,6 +108,7 @@ Have a look at the logs to see how the execution switches from synchronously wai
114
108
</details >
115
109
116
110
## Sagas
111
+ [ <img src =" https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg " >] ( src/sagas/bookingworkflow.go )
117
112
118
113
An example of a trip reservation workflow, using the saga pattern to undo previous steps in case of an error.
119
114
@@ -183,6 +178,7 @@ Have a look at the logs to see the cancellations of the flight and car booking i
183
178
</details >
184
179
185
180
## Stateful Actors and State Machines
181
+ [ <img src =" https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg " >] ( src/statefulactors/machineoperator.go )
186
182
187
183
This example implements a State Machine with a Virtual Object.
188
184
@@ -266,8 +262,19 @@ echo "executing..."
266
262
</details >
267
263
</details >
268
264
265
+ ## Scheduling Tasks
266
+ [ <img src =" https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg " >] ( src/schedulingtasks/paymentreminders.go )
267
+
268
+ This example processes failed payment events from a payment provider.
269
+ The service reminds the customer for 3 days to update their payment details, and otherwise escalates to support.
270
+
271
+ To schedule the reminders, the handler uses Restate's durable timers and delayed calls.
272
+ The handler calls itself three times in a row after a delay of one day, and then stops the loop and calls another handler.
273
+
274
+ Restate tracks the timer across failures, and triggers execution.
269
275
270
276
## Parallelizing work
277
+ [ <img src =" https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg " >] ( src/parallelizework/fanoutworker.go )
271
278
272
279
This example shows how to use the Restate SDK to ** execute a list of tasks in parallel and then gather their result** .
273
280
Also known as fan-out, fan-in.
@@ -279,6 +286,8 @@ Restate guarantees and manages the execution of all the subtasks across failures
279
286
You can run this on FaaS infrastructure, like AWS Lambda, and it will scale automatically.
280
287
281
288
## Transactional Event Processing
289
+ [ <img src =" https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg " >] ( src/eventtransactions/userfeed.go )
290
+
282
291
Processing events (from Kafka) to update various downstream systems.
283
292
- ** Durable side effects** with retries and recovery of partial progress
284
293
- Events get sent to objects based on the Kafka key.
@@ -384,6 +393,7 @@ Processing events (from Kafka) to update various downstream systems.
384
393
< /details>
385
394
386
395
# # Event Enrichment / Joins
396
+ [< img src= " https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg" > ](src/eventenrichment/packagetracker.go)
387
397
388
398
This example shows an example of:
389
399
- ** Event enrichment** over different sources: RPC and Kafka
0 commit comments