Documentation
¶
Overview ¶
Package dispatch provides helper functions for configuring workflow.Context objects with default activity options.
Index ¶
- func WithCustomQueueContext(ctx workflow.Context, q queues.Queue) workflow.Context
- func WithDefaultActivityContext(ctx workflow.Context) workflow.Context
- func WithIgnoredErrorsContext(ctx workflow.Context, args ...string) workflow.Context
- func WithMarathonContext(ctx workflow.Context) workflow.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCustomQueueContext ¶
WithCustomQueueContext returns a workflow.Context with activity options configured with a StartToCloseTimeout of 60 seconds and a dedicated task queue. This allows scheduling activities on a different queue than the one the workflow is running on.
Example:
ctx = shared.WithCustomQueueContext(ctx, queues.MyTaskQueue)
func WithDefaultActivityContext ¶
WithDefaultActivityContext returns a workflow.Context with the default activity options applied. The default options include a StartToCloseTimeout of 60 seconds.
Example:
ctx = shared.WithDefaultActivityContext(ctx)
func WithIgnoredErrorsContext ¶
WithIgnoredErrorsContext returns a workflow.Context with activity options configured with a StartToCloseTimeout of 60 seconds and a RetryPolicy that allows a single attempt and ignores specified error types.
Example:
ignored := []string{"CustomErrorType"} ctx = shared.WithIgnoredErrorsContext(ctx, ignored...)
func WithMarathonContext ¶
WithMarathonContext returns a workflow.Context with activity options configured for long-running activities. It sets the StartToCloseTimeout to 60 minutes and the HeartbeatTimeout to 30 seconds.
Example:
ctx = shared.WithMarathonContext(ctx)
Types ¶
This section is empty.