common

package
v1.2.12-prerelease4 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultAvailabilityThreshold is the default threshold for availability
	DefaultAvailabilityThreshold = 0.99

	// DefaultContextTimeout is the default context timeout for RPC calls
	DefaultContextTimeout = 3 * time.Second
)
View Source
const (
	// DefaultMaxRetryCount is the default max retry count
	DefaultMaxRetryCount = 5
	// DefaultRetryBackoffDuration is the default backoff duration for retry
	DefaultRetryBackoffDuration = 50 * time.Millisecond
)
View Source
const (
	// ErrReasonValidationFailed is the failure reason for validation failure
	ErrReasonValidationFailed = "validation failed"
	// ErrReasonWorkflowNotExist is the error reason for workflow not exist
	ErrReasonWorkflowNotExist = "workflow not exist"
)
View Source
const (
	// EchoActivityName is the name of echoActivity
	EchoActivityName = "echoActivity"
)

Variables

This section is empty.

Functions

func GetActivityServiceConfig

func GetActivityServiceConfig(ctx context.Context) *lib.RuntimeContext

GetActivityServiceConfig returns the service config from activity context Returns nil if the context does not contain the service config

func GetTaskListName

func GetTaskListName(taskListNumber int) string

GetTaskListName returns the task list name for the given task list id

func IsCancellationAlreadyRequestedError

func IsCancellationAlreadyRequestedError(err error) bool

IsCancellationAlreadyRequestedError returns if the err is a CancellationAlreadyRequestedError

func IsEntityNotExistsError

func IsEntityNotExistsError(err error) bool

IsEntityNotExistsError returns if the err is a EntityNotExistsError

func IsNonRetryableError

func IsNonRetryableError(err error) bool

IsNonRetryableError return true if the err is considered non-retryable

func IsServiceBusyError

func IsServiceBusyError(err error) bool

IsServiceBusyError returns if the err is a ServiceBusyError

func RegisterWorker

func RegisterWorker(w worker.Worker)

RegisterWorker registers common activities

func RetryOp

func RetryOp(
	op func() error,
	isNonRetryableError func(error) bool,
) error

RetryOp retries an operation based on the default retry policy

Types

type EchoActivityParams

type EchoActivityParams struct {
	Payload []byte
}

EchoActivityParams is the paramer for echoActivity

Jump to

Keyboard shortcuts

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