client

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

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

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

func (*TaskHubGrpcClient) ListInstanceIDs

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

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) ResumeOrchestration deprecated

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

Deprecated: Use ResumeWorkflow instead.

func (*TaskHubGrpcClient) ResumeWorkflow

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

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

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

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

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

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

type TaskHubGrpcClientOption func(*TaskHubGrpcClient)

TaskHubGrpcClientOption configures a TaskHubGrpcClient.

func WithStatefulHistoryDisabled

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

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

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

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

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