Documentation ¶
Index ¶
- Variables
- func GetWorkflowResult[T any](ctx context.Context, c *Client, instance *workflow.Instance, ...) (T, error)
- type Client
- func (c *Client) CancelWorkflowInstance(ctx context.Context, instance *workflow.Instance) error
- func (c *Client) CreateWorkflowInstance(ctx context.Context, options WorkflowInstanceOptions, wf workflow.Workflow, ...) (*workflow.Instance, error)
- func (c *Client) GetStats(ctx context.Context) (*backend.Stats, error)
- func (c *Client) RemoveWorkflowInstance(ctx context.Context, instance *core.WorkflowInstance) error
- func (c *Client) SignalWorkflow(ctx context.Context, instanceID string, name string, arg any) error
- func (c *Client) WaitForWorkflowInstance(ctx context.Context, instance *workflow.Instance, timeout time.Duration) error
- type WorkflowInstanceOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWorkflowCanceled = errors.New("workflow canceled")
View Source
var ErrWorkflowTerminated = errors.New("workflow terminated")
Functions ¶
func GetWorkflowResult ¶ added in v0.0.4
func GetWorkflowResult[T any](ctx context.Context, c *Client, instance *workflow.Instance, timeout time.Duration) (T, error)
GetWorkflowResult gets the workflow result for the given workflow result. It first waits for the workflow to finish or until the given timeout has expired.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CancelWorkflowInstance ¶
CancelWorkflowInstance cancels a running workflow instance.
func (*Client) CreateWorkflowInstance ¶
func (c *Client) CreateWorkflowInstance(ctx context.Context, options WorkflowInstanceOptions, wf workflow.Workflow, args ...any) (*workflow.Instance, error)
CreateWorkflowInstance creates a new workflow instance of the given workflow.
func (*Client) RemoveWorkflowInstance ¶ added in v0.12.0
RemoveWorkflowInstance removes the given workflow instance from the backend.
func (*Client) SignalWorkflow ¶
SignalWorkflow signals a running workflow instance.
type WorkflowInstanceOptions ¶
type WorkflowInstanceOptions struct {
InstanceID string
}
Click to show internal directories.
Click to hide internal directories.