workflow

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallActivity

func CallActivity[T any, R any](ctx context.Context, activity types.Activity[T, R], input *T) awaitable.Awaitable[*R]

func GetCurrentTimestamp

func GetCurrentTimestamp(ctx context.Context) time.Time

func GetVersion

func GetVersion(ctx context.Context) string

func GetWorkflowExecutionStartedTimestamp

func GetWorkflowExecutionStartedTimestamp(ctx context.Context) time.Time

func IsReplaying added in v0.0.5

func IsReplaying(ctx context.Context) bool

func OnEvent

func OnEvent(ctx context.Context, eventName string, callback func([]byte))

func SetVar

func SetVar[T any](ctx context.Context, name string, value T)

func WaitFor

func WaitFor(ctx context.Context, delay time.Duration)

func WaitUntil

func WaitUntil(ctx context.Context, until time.Time)

Types

type AwaitableActivity

type AwaitableActivity[R any] struct {
	Activity any
	Promise  *workflow.ActivityPromise
}

func (*AwaitableActivity[R]) Await

func (t *AwaitableActivity[R]) Await() (*R, error)

type AwaitableTimer

type AwaitableTimer struct {
	Promise *workflow.TimerPromise
}

func (*AwaitableTimer) Await

func (t *AwaitableTimer) Await() (any, error)

type WorkflowInfo added in v0.0.5

type WorkflowInfo struct {
	WorkflowID                        string
	Version                           string
	WorkflowExecutionStartedTimestamp time.Time
	CurrentTimestamp                  time.Time
	IsReplaying                       bool
}

func GetWorkflowInfo added in v0.0.5

func GetWorkflowInfo(ctx context.Context) *WorkflowInfo

Jump to

Keyboard shortcuts

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