sessioncalls

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Adapted from https://github.com/dynajoe/temporal-terraform-demo/blob/main/heartbeat/heartbeat.go.

Index

Constants

View Source
const (
	CallActivityName = "session_call"
)

Variables

This section is empty.

Functions

func BeginHeartbeat

func BeginHeartbeat(ctx context.Context, interval time.Duration) (context.Context, func())

Types

type CallActivityInputs added in v0.14.0

type CallActivityInputs struct {
	SessionID sdktypes.SessionID
	CallSpec  sdktypes.SessionCallSpec
	Unique    bool
}

type CallActivityOutputs added in v0.14.0

type CallActivityOutputs struct {
	Result sdktypes.SessionCallAttemptResult

	// Ask for a manual retry. This is used when executorsForSessions are not
	// initialized in case the temporal workflow replays AFTER the activity respawns.
	// The manual retry will instruct the workflow to retry it with the correct
	// executorsForSessions is initialized.
	Retry bool
}

type CallOpts added in v0.3.2

type CallOpts struct {
	Catch   bool          `json:"catch"`
	Timeout time.Duration `json:"timeout"`
}

type CallParams

type CallParams struct {
	SessionID sdktypes.SessionID
	CallSpec  sdktypes.SessionCallSpec

	UseTemporalForSessionLogs bool

	Executors *sdkexecutor.Executors // needed for session specific calls (global modules, script functions).
}

type Calls

type Calls interface {
	StartWorkers(context.Context) error
	Call(ctx workflow.Context, params *CallParams) (sdktypes.SessionCallAttemptResult, error)
}

func New

func New(l *zap.Logger, config Config, svcs *sessionsvcs.Svcs) Calls

type Config

type Config struct {
	// common
	Worker temporalclient.WorkerConfig `koanf:"worker"`

	// override above
	GeneralWorker temporalclient.WorkerConfig `koanf:"general_worker"`
	UniqueWorker  temporalclient.WorkerConfig `koanf:"unique_worker"`

	Activity       temporalclient.ActivityConfig `koanf:"activity"`
	UniqueActivity temporalclient.ActivityConfig `koanf:"unique_activity"`

	ActivityHeartbeatInterval time.Duration `koanf:"activity_heartbeat_interval"`
}

Jump to

Keyboard shortcuts

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