client

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 13 Imported by: 4

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) *TaskHubGrpcClient

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

func (*TaskHubGrpcClient) FetchOrchestrationMetadata

FetchOrchestrationMetadata fetches metadata for the specified orchestration from the configured task hub.

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

func (*TaskHubGrpcClient) PurgeOrchestrationState

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

PurgeOrchestrationState deletes the state of the specified orchestration instance.

[api.api.ErrInstanceNotFound] is returned if the specified orchestration 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 orchestration.

func (*TaskHubGrpcClient) ResumeOrchestration

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

ResumeOrchestration resumes an orchestration instance that was previously suspended.

func (*TaskHubGrpcClient) ScheduleNewOrchestration

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

ScheduleNewOrchestration schedules a new orchestration 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

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

SuspendOrchestration suspends an orchestration instance, halting processing of its events until a "resume" operation resumes it.

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

func (*TaskHubGrpcClient) TerminateOrchestration

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

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

func (*TaskHubGrpcClient) WaitForOrchestrationCompletion

func (c *TaskHubGrpcClient) WaitForOrchestrationCompletion(ctx context.Context, id api.InstanceID, opts ...api.FetchOrchestrationMetadataOptions) (*api.OrchestrationMetadata, error)

WaitForOrchestrationCompletion waits for an orchestration to complete and returns an api.OrchestrationMetadata object that contains metadata about the completed instance.

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

func (*TaskHubGrpcClient) WaitForOrchestrationStart

WaitForOrchestrationStart waits for an orchestration to start running and returns an api.OrchestrationMetadata object that contains metadata about the started instance.

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

Jump to

Keyboard shortcuts

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