client

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 22 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskHubGrpcClient

type TaskHubGrpcClient struct {
	// contains filtered or unexported fields
}

func NewTaskHubGrpcClient

func NewTaskHubGrpcClient(cc grpc.ClientConnInterface, logger backend.Logger, opts ...TaskHubGrpcClientOption) *TaskHubGrpcClient

NewTaskHubGrpcClient creates a client that can be used to manage workflows over a gRPC connection. The gRPC connection must be to a task hub worker that understands the Durable Task gRPC protocol.

func (*TaskHubGrpcClient) FetchOrchestrationMetadata deprecated

func (c *TaskHubGrpcClient) FetchOrchestrationMetadata(ctx context.Context, id api.InstanceID, opts ...api.FetchWorkflowMetadataOptions) (*backend.WorkflowMetadata, error)

Deprecated: Use FetchWorkflowMetadata instead.

func (*TaskHubGrpcClient) FetchWorkflowMetadata added in v0.12.0

FetchWorkflowMetadata fetches metadata for the specified workflow from the configured task hub.

api.ErrInstanceNotFound is returned when the specified workflow doesn't exist.

func (*TaskHubGrpcClient) GetInstanceHistory added in v0.11.0

func (*TaskHubGrpcClient) ListInstanceIDs added in v0.11.0

func (*TaskHubGrpcClient) PurgeOrchestrationState deprecated

func (c *TaskHubGrpcClient) PurgeOrchestrationState(ctx context.Context, id api.InstanceID, opts ...api.PurgeOptions) error

Deprecated: Use PurgeWorkflowState instead.

func (*TaskHubGrpcClient) PurgeWorkflowState added in v0.12.0

func (c *TaskHubGrpcClient) PurgeWorkflowState(ctx context.Context, id api.InstanceID, opts ...api.PurgeOptions) error

PurgeWorkflowState deletes the state of the specified workflow instance.

api.ErrInstanceNotFound is returned if the specified workflow instance doesn't exist.

func (*TaskHubGrpcClient) RaiseEvent

func (c *TaskHubGrpcClient) RaiseEvent(ctx context.Context, id api.InstanceID, eventName string, opts ...api.RaiseEventOptions) error

RaiseEvent sends an asynchronous event notification to a waiting workflow.

func (*TaskHubGrpcClient) RerunWorkflowFromEvent added in v0.7.0

func (c *TaskHubGrpcClient) RerunWorkflowFromEvent(ctx context.Context, id api.InstanceID, eventID uint32, opts ...api.RerunOptions) (api.InstanceID, error)

RerunWorkflowFromEvent reruns a workflow from a specific event ID of some source instance ID. If not given, a random new instance ID will be generated and returned. Can optionally give a new input to the target event ID to rerun from.

func (*TaskHubGrpcClient) ResumeOrchestration deprecated

func (c *TaskHubGrpcClient) ResumeOrchestration(ctx context.Context, id api.InstanceID, reason string) error

Deprecated: Use ResumeWorkflow instead.

func (*TaskHubGrpcClient) ResumeWorkflow added in v0.12.0

func (c *TaskHubGrpcClient) ResumeWorkflow(ctx context.Context, id api.InstanceID, reason string, opts ...api.ResumeOptions) error

ResumeWorkflow resumes a workflow instance that was previously suspended.

func (*TaskHubGrpcClient) ScheduleNewOrchestration deprecated

func (c *TaskHubGrpcClient) ScheduleNewOrchestration(ctx context.Context, workflow string, opts ...api.NewWorkflowOptions) (api.InstanceID, error)

Deprecated: Use ScheduleNewWorkflow instead.

func (*TaskHubGrpcClient) ScheduleNewWorkflow added in v0.12.0

func (c *TaskHubGrpcClient) ScheduleNewWorkflow(ctx context.Context, workflow string, opts ...api.NewWorkflowOptions) (api.InstanceID, error)

ScheduleNewWorkflow schedules a new workflow instance with a specified set of options for execution.

func (*TaskHubGrpcClient) StartWorkItemListener

func (c *TaskHubGrpcClient) StartWorkItemListener(ctx context.Context, r *task.TaskRegistry) error

func (*TaskHubGrpcClient) SuspendOrchestration deprecated

func (c *TaskHubGrpcClient) SuspendOrchestration(ctx context.Context, id api.InstanceID, reason string) error

Deprecated: Use SuspendWorkflow instead.

func (*TaskHubGrpcClient) SuspendWorkflow added in v0.12.0

func (c *TaskHubGrpcClient) SuspendWorkflow(ctx context.Context, id api.InstanceID, reason string, opts ...api.SuspendOptions) error

SuspendWorkflow suspends a workflow instance, halting processing of its events until a "resume" operation resumes it.

Note that suspended workflows are still considered to be "running" even though they will not process events.

func (*TaskHubGrpcClient) TerminateOrchestration deprecated

func (c *TaskHubGrpcClient) TerminateOrchestration(ctx context.Context, id api.InstanceID, opts ...api.TerminateOptions) error

Deprecated: Use TerminateWorkflow instead.

func (*TaskHubGrpcClient) TerminateWorkflow added in v0.12.0

func (c *TaskHubGrpcClient) TerminateWorkflow(ctx context.Context, id api.InstanceID, opts ...api.TerminateOptions) error

TerminateWorkflow terminates a running workflow by causing it to stop receiving new events and putting it directly into the TERMINATED state.

func (*TaskHubGrpcClient) WaitForOrchestrationCompletion deprecated

func (c *TaskHubGrpcClient) WaitForOrchestrationCompletion(ctx context.Context, id api.InstanceID, opts ...api.FetchWorkflowMetadataOptions) (*backend.WorkflowMetadata, error)

Deprecated: Use WaitForWorkflowCompletion instead.

func (*TaskHubGrpcClient) WaitForOrchestrationStart deprecated

func (c *TaskHubGrpcClient) WaitForOrchestrationStart(ctx context.Context, id api.InstanceID, opts ...api.FetchWorkflowMetadataOptions) (*backend.WorkflowMetadata, error)

Deprecated: Use WaitForWorkflowStart instead.

func (*TaskHubGrpcClient) WaitForWorkflowCompletion added in v0.12.0

func (c *TaskHubGrpcClient) WaitForWorkflowCompletion(ctx context.Context, id api.InstanceID, opts ...api.FetchWorkflowMetadataOptions) (*backend.WorkflowMetadata, error)

WaitForWorkflowCompletion waits for a workflow to complete and returns an backend.WorkflowMetadata object that contains metadata about the completed instance.

api.ErrInstanceNotFound is returned when the specified workflow doesn't exist.

func (*TaskHubGrpcClient) WaitForWorkflowStart added in v0.12.0

WaitForWorkflowStart waits for a workflow to start running and returns an backend.WorkflowMetadata object that contains metadata about the started instance.

api.ErrInstanceNotFound is returned when the specified workflow doesn't exist.

type TaskHubGrpcClientOption added in v0.13.0

type TaskHubGrpcClientOption func(*TaskHubGrpcClient)

TaskHubGrpcClientOption configures a TaskHubGrpcClient.

func WithStatefulHistoryDisabled added in v0.13.0

func WithStatefulHistoryDisabled() TaskHubGrpcClientOption

WithStatefulHistoryDisabled opts the worker out of the stateful-history optimization: it does not advertise WORKER_CAPABILITY_STATEFUL_HISTORY, so the sidecar sends the full history on every turn and the worker keeps no history cache. Use to fall back to the pre-optimization behavior.

func WithWorkflowHistoryCacheMaxBytes added in v0.13.0

func WithWorkflowHistoryCacheMaxBytes(maxBytes int64) TaskHubGrpcClientOption

WithWorkflowHistoryCacheMaxBytes sets a budget, in bytes (serialized history size), for the worker's stateful-history cache across all instances on a stream. When exceeded, least-recently-used histories are evicted. A non-positive value means no byte limit (the cache is then bounded only by the instance count and TTL).

func WithWorkflowHistoryCacheMaxInstances added in v0.13.0

func WithWorkflowHistoryCacheMaxInstances(maxInstances int) TaskHubGrpcClientOption

WithWorkflowHistoryCacheMaxInstances sets the maximum number of per-instance histories the worker retains on a single stream. A non-positive value keeps the default.

func WithWorkflowHistoryCacheSweepInterval added in v0.13.0

func WithWorkflowHistoryCacheSweepInterval(interval time.Duration) TaskHubGrpcClientOption

WithWorkflowHistoryCacheSweepInterval sets how often the worker reclaims expired history cache entries. A non-positive value keeps the default.

func WithWorkflowHistoryCacheTTL added in v0.13.0

func WithWorkflowHistoryCacheTTL(ttl time.Duration) TaskHubGrpcClientOption

WithWorkflowHistoryCacheTTL sets how long an instance's history is retained in the worker's stateful-history cache after its last turn (sliding window). A non-positive value keeps the default.

Jump to

Keyboard shortcuts

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