workflow

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 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) int64

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)

Jump to

Keyboard shortcuts

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