Documentation ¶
Overview ¶
SPDX-License-Identifier: BSD-2-Clause Copyright (c) 2022-2022 Bitmark Inc. Use of this source code is governed by an BSD 2 Clause license that can be found in the LICENSE file.
cadence package implements both a client and worker Cadence interface
Index ¶
- func BuildCadenceLogger(logLevel int) *zap.Logger
- func BuildCadenceServiceClient(hostPort string, clientName string, cadenceService string) workflowserviceclient.Interface
- func StartWorker(logger *zap.Logger, service workflowserviceclient.Interface, domain string, ...)
- type CadenceWorkerClient
- func (c *CadenceWorkerClient) AddService(clientName string)
- func (c *CadenceWorkerClient) ExecuteWorkflow(ctx context.Context, clientName string, options client.StartWorkflowOptions, ...) (client.WorkflowRun, error)
- func (c *CadenceWorkerClient) StartWorkflow(ctx context.Context, clientName string, options client.StartWorkflowOptions, ...) (*workflow.Execution, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCadenceLogger ¶
BuildCadenceLogger creates a log instance for cadence client
func BuildCadenceServiceClient ¶
func BuildCadenceServiceClient( hostPort string, clientName string, cadenceService string, ) workflowserviceclient.Interface
BuildCadenceServiceClient constructs a cadence client
func StartWorker ¶
func StartWorker(logger *zap.Logger, service workflowserviceclient.Interface, domain string, taskListName string, )
StartWorker starts a cadence worker which watches tasks in the given domain and task list
Types ¶
type CadenceWorkerClient ¶
type CadenceWorkerClient struct {
// contains filtered or unexported fields
}
CadenceWorkerClient manages multiple cadence worker service clients
func NewWorkerClient ¶
func NewWorkerClient( service string, hostPort string, domain string, ) *CadenceWorkerClient
NewWorkerClient creates a new client instance
func (*CadenceWorkerClient) AddService ¶
func (c *CadenceWorkerClient) AddService(clientName string)
AddService register a service client
func (*CadenceWorkerClient) ExecuteWorkflow ¶
func (c *CadenceWorkerClient) ExecuteWorkflow( ctx context.Context, clientName string, options client.StartWorkflowOptions, workflowFunc interface{}, args ...interface{}, ) (client.WorkflowRun, error)
func (*CadenceWorkerClient) StartWorkflow ¶
func (c *CadenceWorkerClient) StartWorkflow( ctx context.Context, clientName string, options client.StartWorkflowOptions, workflowFunc interface{}, args ...interface{}, ) (*workflow.Execution, error)
StartWorkflow triggers a workflow in a specific client