cadence

package
v0.0.0-...-e54010c Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: BSD-2-Clause Imports: 14 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCadenceLogger

func BuildCadenceLogger(logLevel int) *zap.Logger

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

Jump to

Keyboard shortcuts

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