Background heartbeating sample
This shows (and tests) how to have a heartbeat executing inside a loop while performing a long running operation inside an Activity.
This needs to support cancellation as well.
What was changed
Extended the heartbeat demonstration with a realistic long-running activity impl that needs to kick of both a periodic heartbeat and a long-running, blocking process inside an Activity.
For example, writing to a file might take a loooong time but I want to ping the Temporal service in the background while my sync file operation is doing it's thing.
Why?
It should make clearer how to get these concurrent things working together.
Checklist
-
How was this tested:
mochaunit tests. Also verified cancellation works like I'd expect. -
Any docs updates needed? Not really
@mjameswh is there any feedback on this or should I close this and put this in my own repo showing common patterns?
The python samples has an auto-heartbeater sample so I thought this might be a compliment to that.
May 13, 2025
Sorry Mike, I have been very busy on other things. Please leave it open here, it is definitely a good fit for this repo. I will try to review sooner than later.