asyncworkflowqueue

package
v1.4.6-prerelease07 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package asyncworkflowqueue is a generated GoMock package.

Index

Constants

View Source
const ForwardedFromHeaderName = "cadence-async-forwarded-from"

ForwardedFromHeaderName is the envelope header stamped with the name of the cluster that forwarded an async workflow request. A request carrying a stamp from another cluster is never forwarded a second time, bounding forwarding to one hop.

Variables

View Source
var ErrCorruptMessage = errors.New("async workflow queue message is corrupt")

ErrCorruptMessage marks a queue row that can never be decoded, regardless of retries.

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	// Decode returns a wrapped ErrCorruptMessage for a bad row or envelope encoding, a type
	// mismatch, bad bytes or a nil inner request. An error from the domain lookup is returned
	// unwrapped, so callers can tell a row that can never be decoded from a lookup failure.
	Decode(msg *persistence.AsyncWorkflowMessage) (*Request, error)
}

Decoder converts a queue row into a typed request.

func NewDecoder

func NewDecoder(domainIDFn func(domainName string) (string, error)) Decoder

NewDecoder returns a Decoder that resolves domain IDs through domainIDFn.

type MockDecoder

type MockDecoder struct {
	// contains filtered or unexported fields
}

MockDecoder is a mock of Decoder interface.

func NewMockDecoder

func NewMockDecoder(ctrl *gomock.Controller) *MockDecoder

NewMockDecoder creates a new mock instance.

func (*MockDecoder) Decode

Decode mocks base method.

func (*MockDecoder) EXPECT

func (m *MockDecoder) EXPECT() *MockDecoderMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

type MockDecoderMockRecorder

type MockDecoderMockRecorder struct {
	// contains filtered or unexported fields
}

MockDecoderMockRecorder is the mock recorder for MockDecoder.

func (*MockDecoderMockRecorder) Decode

func (mr *MockDecoderMockRecorder) Decode(msg any) *gomock.Call

Decode indicates an expected call of Decode.

type MockProcessor

type MockProcessor struct {
	// contains filtered or unexported fields
}

MockProcessor is a mock of Processor interface.

func NewMockProcessor

func NewMockProcessor(ctrl *gomock.Controller) *MockProcessor

NewMockProcessor creates a new mock instance.

func (*MockProcessor) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockProcessor) Process

func (m *MockProcessor) Process(ctx context.Context, req *Request) error

Process mocks base method.

type MockProcessorMockRecorder

type MockProcessorMockRecorder struct {
	// contains filtered or unexported fields
}

MockProcessorMockRecorder is the mock recorder for MockProcessor.

func (*MockProcessorMockRecorder) Process

func (mr *MockProcessorMockRecorder) Process(ctx, req any) *gomock.Call

Process indicates an expected call of Process.

type Processor

type Processor interface {
	// Process makes one attempt. nil = handled (started, already started, or forwarded).
	Process(ctx context.Context, req *Request) error
}

Processor handles one decoded async workflow queue request.

func NewActiveProcessor

func NewActiveProcessor(engineFn func() engine.Engine, timeSource clock.TimeSource, scope metrics.Scope) Processor

NewActiveProcessor returns a Processor that starts workflows in the shard engine. engineFn is called on every Process; its result is never cached.

The start is an in-process engine call, so the frontend user rate limiter and the history handler's rate limiters do not run. The frontend's async rate limit, applied when the request was accepted, is the throttle for these requests.

func NewForwardProcessor

func NewForwardProcessor(clientBean client.Bean, scope metrics.Scope) Processor

NewForwardProcessor returns a Processor that forwards requests to the frontend of req.ActiveCluster, replaying the yarpc headers captured at accept time.

func NewProcessorWrapper

func NewProcessorWrapper(
	currentCluster string,
	activeClusterMgr activecluster.Manager,
	active Processor,
	notActive Processor,
	logger log.Logger,
) Processor

NewProcessorWrapper returns a Processor that routes to active when the domain is active in currentCluster and to notActive (with req.ActiveCluster set) otherwise.

type Request

type Request struct {
	Message         *persistence.AsyncWorkflowMessage
	DomainID        string
	Start           *types.StartWorkflowExecutionRequest           // set iff RequestType == StartWorkflow
	SignalWithStart *types.SignalWithStartWorkflowExecutionRequest // set iff RequestType == SignalWithStart
	ActiveCluster   string                                         // set by processorWrapper before delegating to the not-active processor
	Headers         map[string][]byte                              // yarpc headers captured by the frontend at accept; nil when absent
}

Request is a decoded async workflow queue row.

Jump to

Keyboard shortcuts

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