dispatch

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package dispatch provides helper functions for configuring workflow.Context objects with default activity options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCustomQueueContext

func WithCustomQueueContext(ctx workflow.Context, q queues.Queue) workflow.Context

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

func WithDefaultActivityContext(ctx workflow.Context) workflow.Context

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

func WithIgnoredErrorsContext(ctx workflow.Context, args ...string) workflow.Context

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

func WithMarathonContext(ctx workflow.Context) workflow.Context

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL