Skip to content

Commit 997afc6

Browse files
committed
add readme
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
1 parent 466594e commit 997afc6

File tree

1 file changed

+15
-0
lines changed
  • core/src/main/java/io/temporal/samples/autoheartbeat

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Auto-heartbeating sample for activities that define HeartbeatTimeout
2+
3+
This sample shows an implementation of an "auto-heartbeating" utility that can be applied via interceptor
4+
to all activities where you define HeartbeatTimeout. Use case where this can be helpful include
5+
situations where you have long-running activities where you want to heartbeat but its difficult
6+
to explicitly call heartbeat api in activity code directly.
7+
8+
1. Start the Sample:
9+
```bash
10+
./gradlew -q execute -PmainClass=io.temporal.samples.autoheartbeat.Starter
11+
```
12+
13+
The sample workflow starts three activities async, two of which define heartbeat timeout.
14+
Activity interceptor in this sample applies the auto-heartbeating util to the two that define heartbeat timeout
15+
and auto-heartbeats at its HeartbeatTimeout - 1s intervals.

0 commit comments

Comments
 (0)