temporalng4

package
v0.0.0-...-cf623d3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFuture

func NewFuture[T any]() (Future[T], FutureResolver[T])

func RegisterActivity

func RegisterActivity[In, Out any](
	worker.Worker,
	func(context.Context, In) (Out, error),
)

func Select

func Select(Context, ...SelectCase) error

func SetWorkflowQueryHandler

func SetWorkflowQueryHandler[In, Out any](Context, WorkflowQuery[In, Out], func(In) (Out, error))

func WorkflowSpec

func WorkflowSpec[Wf workflowSpec]() Wf

Types

type Channel

type Channel[T any] struct {
	SendChannel[T]
	ReceiveChannel[T]
}

func NewChannel

func NewChannel[T any](buffered int) *Channel[T]

type Context

type Context interface {
	Done() ReceiveChannel[struct{}]
	Err() error
	Value(any) any
}

type Future

type Future[T any] struct {
}

func StartActivity

func StartActivity[In, Out any](
	Context,
	func(context.Context, In) (Out, error),
	In,
	StartActivityOptions,
) Future[Out]

func (Future[T]) Get

func (Future[T]) Get() (T, error)

type FutureResolver

type FutureResolver[T any] struct {
}

func (FutureResolver[T]) Resolve

func (FutureResolver[T]) Resolve(T)

func (FutureResolver[T]) ResolveError

func (FutureResolver[T]) ResolveError(error)

type ReceiveChannel

type ReceiveChannel[T any] struct {
}

func GetWorkflowSignalChannel

func GetWorkflowSignalChannel[In any](Context, WorkflowSignal[In]) ReceiveChannel[In]

func (ReceiveChannel[T]) Receive

func (ReceiveChannel[T]) Receive() T

func (ReceiveChannel[T]) TryReceive

func (ReceiveChannel[T]) TryReceive() (T, bool)

type SelectCase

type SelectCase interface {
	// contains filtered or unexported methods
}

func SelectCaseDefault

func SelectCaseDefault(func() error) SelectCase

func SelectCaseFuture

func SelectCaseFuture[T any](Future[T], func(T) error) SelectCase

func SelectCaseReceive

func SelectCaseReceive[T any](ReceiveChannel[T], func(Context, T) error) SelectCase

func SelectCaseSend

func SelectCaseSend[T any](SendChannel[T], T, func() error) SelectCase

func SelectCaseTryReceive

func SelectCaseTryReceive[T any](ReceiveChannel[T], func(Context, T, bool) error) SelectCase

type SendChannel

type SendChannel[T any] struct {
}

func (SendChannel[T]) Send

func (SendChannel[T]) Send(T)

type StartActivityOptions

type StartActivityOptions struct {
}

type Workflow

type Workflow[In, Out any] struct {
}

func (Workflow[In, Out]) GetHandle

func (Workflow[In, Out]) GetHandle(client client.Client, id string) *WorkflowHandle[Out]

func (Workflow[In, Out]) Register

func (Workflow[In, Out]) Register(
	worker.Worker,
	func(Context, In) (Out, error),
)

func (Workflow[In, Out]) Start

type WorkflowHandle

type WorkflowHandle[Out any] struct {
	Client      client.Client
	ID          string
	RunID       string
	ResultRunID string
}

func (*WorkflowHandle[Out]) Get

func (*WorkflowHandle[Out]) Get(context.Context) (Out, error)

func (*WorkflowHandle[Out]) GetID

func (*WorkflowHandle[Out]) GetID() string

func (*WorkflowHandle[Out]) GetRunID

func (*WorkflowHandle[Out]) GetRunID() string

type WorkflowQuery

type WorkflowQuery[In, Out any] struct{}

func (WorkflowQuery[In, Out]) Invoke

func (WorkflowQuery[In, Out]) Invoke(context.Context, client.Client, In, WorkflowQueryOptions) (Out, error)

type WorkflowQueryOptions

type WorkflowQueryOptions struct {
	Workflow   WorkflowRef
	WorkflowID string
	RunID      string
}

type WorkflowRef

type WorkflowRef interface {
	GetID() string
	GetRunID() string
}

type WorkflowSignal

type WorkflowSignal[In any] struct{}

func (WorkflowSignal[In]) Send

type WorkflowSignalOptions

type WorkflowSignalOptions struct {
	Workflow   WorkflowRef
	WorkflowID string
	RunID      string
}

type WorkflowStartOptions

type WorkflowStartOptions struct {
	ID        string
	TaskQueue string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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