temporalng2

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 QueryWorkflow

func QueryWorkflow[Wf Workflow[WfIn, WfOut], WfIn, WfOut, In, Out any](
	context.Context,
	*WorkflowHandle[Wf, WfIn, WfOut],
	func(Wf, In) (Out, error),
	In,
	QueryWorkflowOptions,
) (Out, error)

func RegisterActivities

func RegisterActivities[Act any](worker.Worker, Act)

func RegisterWorkflow

func RegisterWorkflow[Wf Workflow[In, Out], In, Out any](worker.Worker, Wf)

func Select

func Select(Context, ...SelectCase) error

func SignalWorkflow

func SignalWorkflow[Wf Workflow[WfIn, WfOut], WfIn, WfOut, In any](
	context.Context,
	*WorkflowHandle[Wf, WfIn, WfOut],
	func(Wf, Context, In),
	In,
	SignalWorkflowOptions,
) error

Types

type Activity

type Activity[In, Out any] func(context.Context, In) (Out, error)

func (Activity[In, Out]) WithName

func (Activity[In, Out]) WithName(string) Activity[In, Out]

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 CustomNaming

type CustomNaming[Meta any] interface {
}

type ExecuteActivityOptions

type ExecuteActivityOptions struct {
}

type Future

type Future[T any] struct {
}

func ExecuteActivity

func ExecuteActivity[Act any, In, Out any](
	Context,
	func(Act, context.Context, In) (Out, error),
	In,
	ExecuteActivityOptions,
) 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 QueryWorkflowOptions

type QueryWorkflowOptions struct {
}

type ReceiveChannel

type ReceiveChannel[T any] struct {
}

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 SignalWorkflowOptions

type SignalWorkflowOptions struct {
}

type StartWorkflowOptions

type StartWorkflowOptions struct {
	ID        string
	TaskQueue string
}

type Workflow

type Workflow[In, Out any] interface {
	Run(Context, In) (Out, error)
}

type WorkflowHandle

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

func GetWorkflowHandle

func GetWorkflowHandle[Wf Workflow[In, Out], In, Out any](
	client client.Client,
	workflowRun func(Wf, Context, In) (Out, error),
	id string,
) *WorkflowHandle[Wf, In, Out]

func GetWorkflowHandleForRunID

func GetWorkflowHandleForRunID[Wf Workflow[In, Out], In, Out any](
	client client.Client,
	workflowRun func(Wf, Context, In) (Out, error),
	id, runID string,
) *WorkflowHandle[Wf, In, Out]

func StartWorkflow

func StartWorkflow[Wf Workflow[In, Out], In, Out any](
	context.Context,
	client.Client,
	func(Wf, Context, In) (Out, error),
	In,
	StartWorkflowOptions,
) (*WorkflowHandle[Wf, In, Out], error)

func (*WorkflowHandle[Wf, In, Out]) Get

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

func (*WorkflowHandle[Wf, In, Out]) GetID

func (*WorkflowHandle[Wf, In, Out]) GetID() string

func (*WorkflowHandle[Wf, In, Out]) GetRunID

func (*WorkflowHandle[Wf, In, Out]) GetRunID() string

type WorkflowRef

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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