Documentation ¶
Index ¶
- func QueryWorkflowFunc[Req, Resp temporal.Value](ctx context.Context, c Client, workflowID string, runID string, ...) (Resp, error)
- type Client
- type StartWorkflowOptions
- type WorkflowClient
- func (wfc *WorkflowClient[Req, Resp]) Run(ctx context.Context, workflowID string, req Req) (Resp, error)
- func (wfc *WorkflowClient[Req, Resp]) Start(ctx context.Context, workflowID string, req Req) (*WorkflowRun[Resp], error)
- func (wfc *WorkflowClient[Req, Resp]) WithOptions(opts StartWorkflowOptions) *WorkflowClient[Req, Resp]
- func (wfc *WorkflowClient[Req, Resp]) WithTaskQueue(taskQueue string) *WorkflowClient[Req, Resp]
- type WorkflowRun
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 StartWorkflowOptions ¶
type StartWorkflowOptions = client.StartWorkflowOptions
type WorkflowClient ¶
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 ¶
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]) GetID ¶
func (wfr *WorkflowRun[T]) GetID() string
func (*WorkflowRun[T]) GetRunID ¶
func (wfr *WorkflowRun[T]) GetRunID() string