Documentation
¶
Overview ¶
Package asyncworkflowqueue is a generated GoMock package.
Index ¶
Constants ¶
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 ¶
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.
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 ¶
func (m *MockDecoder) Decode(msg *persistence.AsyncWorkflowMessage) (*Request, error)
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.
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 ¶
func (m *MockProcessor) EXPECT() *MockProcessorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockProcessorMockRecorder ¶
type MockProcessorMockRecorder struct {
// contains filtered or unexported fields
}
MockProcessorMockRecorder is the mock recorder for MockProcessor.
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 ¶
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.