client

package
v0.0.0-...-f17583e Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueryWorkflowFunc

func QueryWorkflowFunc[Req, Resp temporal.Value](
	ctx context.Context,
	c Client,
	workflowID string, runID string,
	queryType string,
	query func(Req) (Resp, error),
	req Req,
) (Resp, error)

TODO(jlegrone): This has some problems, mainly that the query func must accept

an argument (which is a common case).

Types

type Client

type Client = client.Client

type StartWorkflowOptions

type StartWorkflowOptions = client.StartWorkflowOptions

type WorkflowClient

type WorkflowClient[Req, Resp temporal.Value] struct {
	// contains filtered or unexported fields
}

WorkflowClient provides type safe methods for interacting with a given workflow type.

func NewNamedWorkflowClient

func NewNamedWorkflowClient[Req, Resp temporal.Value](
	client Client,
	workflowType string,
) *WorkflowClient[Req, Resp]

NewNamedWorkflowClient instantiates a client for a given workflow type.

func NewWorkflowClient

func NewWorkflowClient[Req, Resp temporal.Value](
	client Client,
	workflow func(workflow.Context, Req) (Resp, error),
) *WorkflowClient[Req, Resp]

NewWorkflowClient instantiates a client for a given workflow func.

func (*WorkflowClient[Req, Resp]) Run

func (wfc *WorkflowClient[Req, Resp]) Run(ctx context.Context, workflowID string, req Req) (Resp, error)

Run starts a workflow and waits for it to complete, returning the result.

func (*WorkflowClient[Req, Resp]) Start

func (wfc *WorkflowClient[Req, Resp]) Start(ctx context.Context, workflowID string, req Req) (*WorkflowRun[Resp], error)

Start begins a workflow execution but does not block on its completion.

func (*WorkflowClient[Req, Resp]) WithOptions

func (wfc *WorkflowClient[Req, Resp]) WithOptions(opts StartWorkflowOptions) *WorkflowClient[Req, Resp]

WithOptions sets default start options for workflow executions.

func (*WorkflowClient[Req, Resp]) WithTaskQueue

func (wfc *WorkflowClient[Req, Resp]) WithTaskQueue(taskQueue string) *WorkflowClient[Req, Resp]

WithTaskQueue sets the default task queue for workflows executed with this client.

type WorkflowRun

type WorkflowRun[T temporal.Value] struct {
	// contains filtered or unexported fields
}

func ExecuteWorkflowFunc

func ExecuteWorkflowFunc[Req, Resp temporal.Value](
	ctx context.Context,
	c Client,
	opts client.StartWorkflowOptions,
	workflow func(workflow.Context, Req) (Resp, error),
	req Req,
) (*WorkflowRun[Resp], error)

Alternative to WorkflowClient. We should probably choose one or the other to expose.

func WrapWorkflowRun

func WrapWorkflowRun[T temporal.Value](wfr client.WorkflowRun) *WorkflowRun[T]

func (*WorkflowRun[T]) Get

func (wfr *WorkflowRun[T]) Get(ctx context.Context) (T, error)

func (*WorkflowRun[T]) GetID

func (wfr *WorkflowRun[T]) GetID() string

func (*WorkflowRun[T]) GetRunID

func (wfr *WorkflowRun[T]) GetRunID() string

Jump to

Keyboard shortcuts

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