Skip to content

Commit 409c984

Browse files
Copilotcschleiden
andcommitted
Add comments and documentation for WorkflowLockTimeout and ActivityLockTimeout options
- Add GoDoc comments for WithWorkflowLockTimeout and WithActivityLockTimeout functions - Add both options to public documentation in _backends.md with default values - Addresses review feedback on PR #403 Co-authored-by: cschleiden <[email protected]>
1 parent 22feed6 commit 409c984

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

backend/options.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,16 @@ func WithWorkerName(workerName string) BackendOption {
124124
}
125125
}
126126

127+
// WithWorkflowLockTimeout sets the timeout for workflow task locks. If a workflow task is not completed
128+
// within this timeframe, it's considered abandoned and another worker might pick it up.
127129
func WithWorkflowLockTimeout(timeout time.Duration) BackendOption {
128130
return func(o *Options) {
129131
o.WorkflowLockTimeout = timeout
130132
}
131133
}
132134

135+
// WithActivityLockTimeout sets the timeout for activity task locks. If an activity task is not completed
136+
// within this timeframe, it's considered abandoned and another worker might pick it up.
133137
func WithActivityLockTimeout(timeout time.Duration) BackendOption {
134138
return func(o *Options) {
135139
o.ActivityLockTimeout = timeout

docs/source/includes/_backends.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
There are three backend implementations maintained in this repository. Some backend implementations have custom options and all of them accept:
44

55
- `WithStickyTimeout(timeout time.Duration)` - Set the timeout for sticky tasks. Defaults to 30 seconds
6+
- `WithWorkflowLockTimeout(timeout time.Duration)` - Set the timeout for workflow task locks. Defaults to 1 minute
7+
- `WithActivityLockTimeout(timeout time.Duration)` - Set the timeout for activity task locks. Defaults to 2 minutes
68
- `WithLogger(logger *slog.Logger)` - Set the logger implementation
79
- `WithMetrics(client metrics.Client)` - Set the metrics client
810
- `WithTracerProvider(tp trace.TracerProvider)` - Set the OpenTelemetry tracer provider

0 commit comments

Comments
 (0)