temporal

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 7

Documentation

Overview

Package temporal provides utility functions for the Temporal Go SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstHistoryEvent added in v0.8.0

func GetLogger

func GetLogger(ctx context.Context) logr.Logger

func Logger

func Logger(logger logr.Logger) temporalsdk_log.Logger

Logger returns a logger for the Temporal Go SDK.

func NewLoggerInterceptor

func NewLoggerInterceptor(logger logr.Logger) *workerInterceptor

NewWorkerInterceptor returns an interceptor that makes the application logger available to activities via context.

func NewNonRetryableError added in v0.8.0

func NewNonRetryableError(err error) error

func NonRetryableError

func NonRetryableError(err error) bool

Types

type AutoHeartbeat

type AutoHeartbeat struct {
	// contains filtered or unexported fields
}

func StartAutoHeartbeat

func StartAutoHeartbeat(ctx context.Context) *AutoHeartbeat

StartAutoHeartbeat starts an auto-heartbeat helper for activities.

The interval is chosen to be one-third of the configured timeout to ensure frequent heartbeats. It is capped at a maximum of 10s to prevent the interval from being too large.

func Activity(ctx context.Context) error {
	h := temporal.StartAutoHeartbeat(ctx)
	defer h.Stop()

	// ... long running code.

	return nil
}

Temporal is planning to provide auto-heartbeating capabilities in the future, see https://github.com/temporalio/features/issues/229 for more.

func (*AutoHeartbeat) Stop

func (m *AutoHeartbeat) Stop()

Jump to

Keyboard shortcuts

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