Skip to content

Commit f98d790

Browse files
committed
Add Show code buttons to go readme
1 parent dae9f59 commit f98d790

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

go/patterns-use-cases/README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Common tasks and patterns implemented with Restate:
2121
- **[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)
2222

2323
## 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)
2425

2526
This example shows:
2627
- **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
5960
</details>
6061

6162
## (Delayed) Message Queue
63+
[<img src="https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg">](src/queue/client/tasksubmitter.go)
6264

6365
Use Restate as a queue. Schedule tasks for now or later and ensure the task is only executed once.
6466

@@ -69,6 +71,7 @@ Use Restate as a queue. Schedule tasks for now or later and ensure the task is o
6971
- [Async Task Worker](src/queue/service/asynctaskworker.go): gets invoked by Restate for each task in the queue.
7072

7173
## Webhook Callbacks
74+
[<img src="https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg">](src/webhookcallbacks/callbackrouter.go)
7275

7376
This example processes webhook callbacks from a payment provider.
7477

@@ -77,17 +80,8 @@ This turns handlers into durable event processors that ensure the event is proce
7780

7881
You don't need to do anything special!
7982

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-
9083
## 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)
9185

9286
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**.
9387

@@ -114,6 +108,7 @@ Have a look at the logs to see how the execution switches from synchronously wai
114108
</details>
115109

116110
## Sagas
111+
[<img src="https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg">](src/sagas/bookingworkflow.go)
117112

118113
An example of a trip reservation workflow, using the saga pattern to undo previous steps in case of an error.
119114

@@ -183,6 +178,7 @@ Have a look at the logs to see the cancellations of the flight and car booking i
183178
</details>
184179

185180
## Stateful Actors and State Machines
181+
[<img src="https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg">](src/statefulactors/machineoperator.go)
186182

187183
This example implements a State Machine with a Virtual Object.
188184

@@ -266,8 +262,19 @@ echo "executing..."
266262
</details>
267263
</details>
268264

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.
269275

270276
## Parallelizing work
277+
[<img src="https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg">](src/parallelizework/fanoutworker.go)
271278

272279
This example shows how to use the Restate SDK to **execute a list of tasks in parallel and then gather their result**.
273280
Also known as fan-out, fan-in.
@@ -279,6 +286,8 @@ Restate guarantees and manages the execution of all the subtasks across failures
279286
You can run this on FaaS infrastructure, like AWS Lambda, and it will scale automatically.
280287

281288
## Transactional Event Processing
289+
[<img src="https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg">](src/eventtransactions/userfeed.go)
290+
282291
Processing events (from Kafka) to update various downstream systems.
283292
- **Durable side effects** with retries and recovery of partial progress
284293
- Events get sent to objects based on the Kafka key.
@@ -384,6 +393,7 @@ Processing events (from Kafka) to update various downstream systems.
384393
</details>
385394
386395
## Event Enrichment / Joins
396+
[<img src="https://raw.githubusercontent.com/restatedev/img/refs/heads/main/show-code.svg">](src/eventenrichment/packagetracker.go)
387397
388398
This example shows an example of:
389399
- **Event enrichment** over different sources: RPC and Kafka

0 commit comments

Comments
 (0)