Documentation ¶
Index ¶
- type TaskHubGrpcClient
- func (c *TaskHubGrpcClient) FetchOrchestrationMetadata(ctx context.Context, id api.InstanceID, ...) (*api.OrchestrationMetadata, error)
- func (c *TaskHubGrpcClient) PurgeOrchestrationState(ctx context.Context, id api.InstanceID) error
- func (c *TaskHubGrpcClient) RaiseEvent(ctx context.Context, id api.InstanceID, eventName string, ...) error
- func (c *TaskHubGrpcClient) ResumeOrchestration(ctx context.Context, id api.InstanceID, reason string) error
- func (c *TaskHubGrpcClient) ScheduleNewOrchestration(ctx context.Context, orchestrator string, opts ...api.NewOrchestrationOptions) (api.InstanceID, error)
- func (c *TaskHubGrpcClient) StartWorkItemListener(ctx context.Context, r *task.TaskRegistry) error
- func (c *TaskHubGrpcClient) SuspendOrchestration(ctx context.Context, id api.InstanceID, reason string) error
- func (c *TaskHubGrpcClient) TerminateOrchestration(ctx context.Context, id api.InstanceID, opts ...api.TerminateOptions) error
- func (c *TaskHubGrpcClient) WaitForOrchestrationCompletion(ctx context.Context, id api.InstanceID, ...) (*api.OrchestrationMetadata, error)
- func (c *TaskHubGrpcClient) WaitForOrchestrationStart(ctx context.Context, id api.InstanceID, ...) (*api.OrchestrationMetadata, error)
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 ¶
func (c *TaskHubGrpcClient) FetchOrchestrationMetadata(ctx context.Context, id api.InstanceID, opts ...api.FetchOrchestrationMetadataOptions) (*api.OrchestrationMetadata, error)
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 ¶
func (c *TaskHubGrpcClient) WaitForOrchestrationStart(ctx context.Context, id api.InstanceID, opts ...api.FetchOrchestrationMetadataOptions) (*api.OrchestrationMetadata, error)
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.