temporalio / temporalio/features
[Feature Request] Auto heartbeating
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 32
- Forks
- 28
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 7
Description
Describe the solution you'd like
Users may want to use heartbeater as a simple keep alive and may not want to setup heartbeats inside of their activity code. We have traditionally left this up to users, but enough users are building "auto heartbeaters" which just wrap activities and start an async timer that they stop when activity is done.
After discussion, this is the decision:
- Each SDK should provide an auto-heartbeating helper
- After discussion, we discourage this so it's not a worker or activity option, but a helper they have to explicitly invoke
- The auto heartbeater should automatically send a heartbeat sans details every X of the heartbeat timeout (where X is probably the normal heartbeat throttle interval)
- If a user attempts to manually heartbeat while auto heartbeater running, an exception is thrown from the manual heartbeat call
- After discussion it was decided that this is a better option than letting users mix auto and manual and deciding whether to keep sending old details or what
- Documentation for the auto heartbeater should discourage its use, warning that a stalled yet not complete activity will continue to heartbeat
This is not an option, this is a helper. So in Go it might look like:
func MyActivity(ctx context.Context) error {
h := activity.StartAutoHeartbeat(ctx)
defer h.Stop()
// ... rest of your code
}
(taken from my forum post at https://community.temporal.io/t/why-doesnt-the-sdk-go-have-enableautoheartbeat/6340/2)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed Go entry point, activity.StartAutoHeartbeat(ctx), and review how the SDK currently sends activity heartbeats and exposes manual heartbeat calls. The work is complete when each SDK has an explicitly invoked helper that sends heartbeats, stops cleanly, rejects manual heartbeats while active, and includes the requested warning documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100