temporal

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorIs

func ErrorIs(err, target error) (match bool)

func WithChildWorkflowParentClosePolicy_ABANDON

func WithChildWorkflowParentClosePolicy_ABANDON(ctx workflow.Context) workflow.Context

func WithDefaultActivityOptions

func WithDefaultActivityOptions(ctx workflow.Context) workflow.Context

func WithInfiniteRetryActivityPolicy

func WithInfiniteRetryActivityPolicy(ctx workflow.Context) workflow.Context

func WithInfiniteRetryAndMaxBackoffActivityPolicy

func WithInfiniteRetryAndMaxBackoffActivityPolicy(ctx workflow.Context, maxInterval time.Duration) workflow.Context

Types

type ActivityOptionsBuilder

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

ActivityOptionsBuilder helps build workflow.ActivityOptions.

func NewActivityOptionsBuilder

func NewActivityOptionsBuilder() ActivityOptionsBuilder

NewActivityOptionsBuilder creates a new ActivityOptionsBuilder.

func (ActivityOptionsBuilder) Build

Build constructs the workflow.ActivityOptions.

func (ActivityOptionsBuilder) WithActivityID

func (b ActivityOptionsBuilder) WithActivityID(activityID string) ActivityOptionsBuilder

WithActivityID sets the ActivityID.

func (ActivityOptionsBuilder) WithDisableEagerExecution

func (b ActivityOptionsBuilder) WithDisableEagerExecution(disable bool) ActivityOptionsBuilder

WithDisableEagerExecution sets the DisableEagerExecution flag.

func (ActivityOptionsBuilder) WithHeartbeatTimeout

func (b ActivityOptionsBuilder) WithHeartbeatTimeout(d time.Duration) ActivityOptionsBuilder

WithHeartbeatTimeout sets the HeartbeatTimeout.

func (ActivityOptionsBuilder) WithOptions

func (ActivityOptionsBuilder) WithProviders

func (ActivityOptionsBuilder) WithProvidersWhenSupported

func (b ActivityOptionsBuilder) WithProvidersWhenSupported(providers ...any) ActivityOptionsBuilder

func (ActivityOptionsBuilder) WithRetryPolicy

WithRetryPolicy sets the RetryPolicy.

func (ActivityOptionsBuilder) WithScheduleToCloseTimeout

func (b ActivityOptionsBuilder) WithScheduleToCloseTimeout(d time.Duration) ActivityOptionsBuilder

WithScheduleToCloseTimeout sets the ScheduleToCloseTimeout.

func (ActivityOptionsBuilder) WithScheduleToStartTimeout

func (b ActivityOptionsBuilder) WithScheduleToStartTimeout(d time.Duration) ActivityOptionsBuilder

WithScheduleToStartTimeout sets the ScheduleToStartTimeout.

func (ActivityOptionsBuilder) WithStartToCloseTimeout

func (b ActivityOptionsBuilder) WithStartToCloseTimeout(d time.Duration) ActivityOptionsBuilder

WithStartToCloseTimeout sets the StartToCloseTimeout.

func (ActivityOptionsBuilder) WithTaskQueue

func (b ActivityOptionsBuilder) WithTaskQueue(taskQueue string) ActivityOptionsBuilder

WithTaskQueue sets the task queue.

func (ActivityOptionsBuilder) WithVersioningIntent

WithVersioningIntent sets the VersioningIntent.

func (ActivityOptionsBuilder) WithWaitForCancellation

func (b ActivityOptionsBuilder) WithWaitForCancellation(wait bool) ActivityOptionsBuilder

WithWaitForCancellation sets the WaitForCancellation flag.

type ActivityOptionsProvider

type ActivityOptionsProvider interface {
	ActivityOptions(builder ActivityOptionsBuilder) ActivityOptionsBuilder
}

type ExecuteParams

type ExecuteParams[T any] struct {
	Request T
	Options []WorkflowOptionFunc
}

type ExecuteWithSignalParams

type ExecuteWithSignalParams[T, S any] struct {
	Request T
	Signal  S
	Options []WorkflowOptionFunc
}

type Future

type Future[T any] interface {
	Get(ctx workflow.Context) (res T, err error)
	IsReady() bool
	Underlying() workflow.Future
	Select(workflow.Selector, FutureCallback[T]) workflow.Selector
}

func NewFuture

func NewFuture[T any](f workflow.Future) Future[T]

type FutureCallback

type FutureCallback[T any] func(Future[T])

type GetHandleOpts

type GetHandleOpts struct {
	WorkflowID string
	RunID      string
}

type SignalCallback

type SignalCallback[T any] func(res T, more bool)

type SignalChannel

type SignalChannel[T any] interface {
	// Name returns the name of the signal channel
	Name() string

	// Receive blocks until the signalChannel is received
	// more is false if the channel was closed
	Receive(ctx workflow.Context) (res T, more bool)

	// ReceiveAsync checks for a signalChannel without blocking
	// returns ok of false when no value was found in the channel
	ReceiveAsync() (res T, ok bool)

	// ReceiveWithTimeout blocks until a signalChannel is received or the timeout expires.
	// Returns more as false when Channel is closed.
	// Returns ok as false when no value was found in the channel for the duration of timeout or the ctx was canceled.
	ReceiveWithTimeout(ctx workflow.Context, timeout time.Duration) (res T, ok bool, more bool)

	// ReceiveAsyncWithMore checks for a signalChannel without blocking
	// returns ok as false when no value was found in the channel
	// returns more as false when the channel is closed
	ReceiveAsyncWithMore() (res T, ok bool, more bool)

	// Select checks for signalChannel without blocking
	Select(sel workflow.Selector, fn SignalCallback[T]) workflow.Selector

	// Len returns the number of elements in the channel
	Len() int
}

func NewSignalChannel

func NewSignalChannel[T any](ctx workflow.Context, signalName string) SignalChannel[T]

type SignalHandle

type SignalHandle interface {
	// Get blocks until the future is ready
	Get(workflow.Context) error

	// IsReady returns true when Get is guaranteed not to block
	IsReady() bool
}

func NewSignalHandle

func NewSignalHandle[T any](future workflow.Future) SignalHandle

type SignalPublisherClient

type SignalPublisherClient[T any, U any] struct {
	Client               client.Client
	WorkflowID           string
	SignalName           string
	Workflow             any
	WorkflowStartMessage U
	StartOptions         client.StartWorkflowOptions
}

func (SignalPublisherClient[T, U]) Publish

func (s SignalPublisherClient[T, U]) Publish(ctx context.Context, message T) (err error)

type UpdateHandle

type UpdateHandle[T any] interface {
	// UpdateID returns the ID of this update
	UpdateID() string

	// WorkflowID returns the workflowID of the workflow
	WorkflowID() string

	// RunID returns the runID of the workflow
	RunID() string

	// Get blocks until the future is ready
	Get(ctx context.Context) (T, error)
}

func NewUpdateHandle

func NewUpdateHandle[T any](handle client.WorkflowUpdateHandle) UpdateHandle[T]

type UpdateOptionsBuilder

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

UpdateOptionsBuilder helps build workflow.ActivityOptions.

func NewUpdateOptionsBuilder

func NewUpdateOptionsBuilder() UpdateOptionsBuilder

NewUpdateOptionsBuilder creates a new UpdateOptionsBuilder.

func (UpdateOptionsBuilder) Build

Build constructs the workflow.ActivityOptions.

func (UpdateOptionsBuilder) WithArgs

func (b UpdateOptionsBuilder) WithArgs(args ...any) UpdateOptionsBuilder

func (UpdateOptionsBuilder) WithFirstExecutionRunID

func (b UpdateOptionsBuilder) WithFirstExecutionRunID(id string) UpdateOptionsBuilder

func (UpdateOptionsBuilder) WithOptions

func (UpdateOptionsBuilder) WithProviders

func (b UpdateOptionsBuilder) WithProviders(providers ...UpdateOptionsProvider) UpdateOptionsBuilder

func (UpdateOptionsBuilder) WithProvidersWhenSupported

func (b UpdateOptionsBuilder) WithProvidersWhenSupported(providers ...any) UpdateOptionsBuilder

func (UpdateOptionsBuilder) WithRunID

func (UpdateOptionsBuilder) WithUpdateID

func (UpdateOptionsBuilder) WithUpdateName

func (b UpdateOptionsBuilder) WithUpdateName(name string) UpdateOptionsBuilder

func (UpdateOptionsBuilder) WithWaitForStage

func (UpdateOptionsBuilder) WithWorkflowID

func (b UpdateOptionsBuilder) WithWorkflowID(id string) UpdateOptionsBuilder

type UpdateOptionsProvider

type UpdateOptionsProvider interface {
	UpdateOptions(builder UpdateOptionsBuilder) UpdateOptionsBuilder
}

type WorkerFactory

type WorkerFactory interface {
	Build() worker.Worker
}

type WorkflowOptionsBuilder

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

WorkflowOptionsBuilder helps build both StartWorkflowOptions and ChildWorkflowOptions.

func NewWorkflowOptionsBuilder

func NewWorkflowOptionsBuilder() WorkflowOptionsBuilder

NewWorkflowOptionsBuilder creates a new WorkflowOptionsBuilder.

func (WorkflowOptionsBuilder) AsChildOptions

AsChildOptions constructs the workflow.ChildWorkflowOptions.

func (WorkflowOptionsBuilder) AsStartOptions

AsStartOptions constructs the workflow.StartWorkflowOptions.

func (WorkflowOptionsBuilder) WithCronSchedule

func (b WorkflowOptionsBuilder) WithCronSchedule(schedule string) WorkflowOptionsBuilder

WithCronSchedule sets the cron schedule (for StartWorkflowOptions).

func (WorkflowOptionsBuilder) WithEnableEagerStart

func (b WorkflowOptionsBuilder) WithEnableEagerStart(enable bool) WorkflowOptionsBuilder

WithEnableEagerStart enables or disables eager workflow start.

func (WorkflowOptionsBuilder) WithID

WithID sets the ID for StartWorkflowOptions and WorkflowID for ChildWorkflowOptions.

func (WorkflowOptionsBuilder) WithIdReusePolicy

func (b WorkflowOptionsBuilder) WithIdReusePolicy(policy enums.WorkflowIdReusePolicy) WorkflowOptionsBuilder

WithIdReusePolicy sets the workflow ID reuse policy.

func (WorkflowOptionsBuilder) WithMemo

func (b WorkflowOptionsBuilder) WithMemo(memo map[string]interface{}) WorkflowOptionsBuilder

WithMemo sets the memo.

func (WorkflowOptionsBuilder) WithNamespace

func (b WorkflowOptionsBuilder) WithNamespace(namespace string) WorkflowOptionsBuilder

WithNamespace sets the namespace (for ChildWorkflowOptions).

func (WorkflowOptionsBuilder) WithOptions

WithOptions applies the provided option functions to the builder.

func (WorkflowOptionsBuilder) WithParentClosePolicy

func (b WorkflowOptionsBuilder) WithParentClosePolicy(policy enums.ParentClosePolicy) WorkflowOptionsBuilder

WithParentClosePolicy sets the parent close policy (for ChildWorkflowOptions).

func (WorkflowOptionsBuilder) WithProviders

WithProviders applies the provided providers to the builder.

func (WorkflowOptionsBuilder) WithProvidersWhenSupported

func (b WorkflowOptionsBuilder) WithProvidersWhenSupported(providers ...any) WorkflowOptionsBuilder

WithProvidersWhenSupported applies the provided providers to the builder if they implement WorkflowOptionsProvider.

func (WorkflowOptionsBuilder) WithRetryPolicy

WithRetryPolicy sets the retry policy.

func (WorkflowOptionsBuilder) WithStartDelay

WithStartDelay sets the start delay duration.

func (WorkflowOptionsBuilder) WithStartOperation

WithStartOperation sets the start operation option (for StartWorkflowOptions).

func (WorkflowOptionsBuilder) WithStaticDetails

func (b WorkflowOptionsBuilder) WithStaticDetails(details string) WorkflowOptionsBuilder

WithStaticDetails sets the static details.

func (WorkflowOptionsBuilder) WithStaticSummary

func (b WorkflowOptionsBuilder) WithStaticSummary(summary string) WorkflowOptionsBuilder

WithStaticSummary sets the static summary.

func (WorkflowOptionsBuilder) WithTaskQueue

func (b WorkflowOptionsBuilder) WithTaskQueue(taskQueue string) WorkflowOptionsBuilder

WithTaskQueue sets the task queue.

func (WorkflowOptionsBuilder) WithVersioningIntent

WithVersioningIntent sets the versioning intent.

func (WorkflowOptionsBuilder) WithWaitForCancellation

func (b WorkflowOptionsBuilder) WithWaitForCancellation(wait bool) WorkflowOptionsBuilder

WithWaitForCancellation sets the wait for cancellation flag (for ChildWorkflowOptions).

func (WorkflowOptionsBuilder) WithWorkflowExecutionErrorIfAlreadyStarted

func (b WorkflowOptionsBuilder) WithWorkflowExecutionErrorIfAlreadyStarted(flag bool) WorkflowOptionsBuilder

WithWorkflowExecutionErrorIfAlreadyStarted sets whether to return an error if the workflow is already started.

func (WorkflowOptionsBuilder) WithWorkflowExecutionTimeout

func (b WorkflowOptionsBuilder) WithWorkflowExecutionTimeout(d time.Duration) WorkflowOptionsBuilder

WithWorkflowExecutionTimeout sets the workflow execution timeout.

func (WorkflowOptionsBuilder) WithWorkflowIDConflictPolicy

func (b WorkflowOptionsBuilder) WithWorkflowIDConflictPolicy(policy enums.WorkflowIdConflictPolicy) WorkflowOptionsBuilder

WithWorkflowIDConflictPolicy sets the workflow ID conflict policy.

func (WorkflowOptionsBuilder) WithWorkflowIDReusePolicy

func (b WorkflowOptionsBuilder) WithWorkflowIDReusePolicy(policy enums.WorkflowIdReusePolicy) WorkflowOptionsBuilder

WithWorkflowIDReusePolicy sets the workflow ID reuse policy.

func (WorkflowOptionsBuilder) WithWorkflowRunTimeout

func (b WorkflowOptionsBuilder) WithWorkflowRunTimeout(d time.Duration) WorkflowOptionsBuilder

WithWorkflowRunTimeout sets the workflow run timeout.

func (WorkflowOptionsBuilder) WithWorkflowTaskTimeout

func (b WorkflowOptionsBuilder) WithWorkflowTaskTimeout(d time.Duration) WorkflowOptionsBuilder

WithWorkflowTaskTimeout sets the workflow task timeout.

type WorkflowOptionsProvider

type WorkflowOptionsProvider interface {
	WorkflowOptions(options WorkflowOptionsBuilder) WorkflowOptionsBuilder
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳