events

package
v1.25.0-118.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package events is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	fx.Provide(func(executionManager persistence.ExecutionManager, config *configs.Config, handler metrics.Handler, logger log.Logger) Cache {
		return NewHostLevelEventsCache(executionManager, config, handler, logger, false)
	}),
)

Functions

func VerifyHistoryIsComplete added in v1.25.0

func VerifyHistoryIsComplete(
	events []*historypb.HistoryEvent,
	expectedFirstEventID int64,
	expectedLastEventID int64,
	isFirstPage bool,
	isLastPage bool,
	pageSize int,
) error

Types

type Cache

type Cache interface {
	GetEvent(ctx context.Context, shardID int32, key EventKey, firstEventID int64, branchToken []byte) (*historypb.HistoryEvent, error)
	PutEvent(key EventKey, event *historypb.HistoryEvent)
	DeleteEvent(key EventKey)
}

func NewHostLevelEventsCache added in v1.24.0

func NewHostLevelEventsCache(
	executionManager persistence.ExecutionManager,
	config *configs.Config,
	handler metrics.Handler,
	logger log.Logger,
	disabled bool,
) Cache

func NewShardLevelEventsCache added in v1.24.0

func NewShardLevelEventsCache(
	executionManager persistence.ExecutionManager,
	config *configs.Config,
	handler metrics.Handler,
	logger log.Logger,
	disabled bool,
) Cache

type CacheImpl

type CacheImpl struct {
	cache.Cache
	// contains filtered or unexported fields
}

func (*CacheImpl) DeleteEvent

func (e *CacheImpl) DeleteEvent(key EventKey)

func (*CacheImpl) GetEvent

func (e *CacheImpl) GetEvent(ctx context.Context, shardID int32, key EventKey, firstEventID int64, branchToken []byte) (*historypb.HistoryEvent, error)

func (*CacheImpl) PutEvent

func (e *CacheImpl) PutEvent(key EventKey, event *historypb.HistoryEvent)

type EventKey added in v1.12.0

type EventKey struct {
	NamespaceID namespace.ID
	WorkflowID  string
	RunID       string
	EventID     int64
	Version     int64
}

type MockCache

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

MockCache is a mock of Cache interface.

func NewMockCache

func NewMockCache(ctrl *gomock.Controller) *MockCache

NewMockCache creates a new mock instance.

func (*MockCache) DeleteEvent

func (m *MockCache) DeleteEvent(key EventKey)

DeleteEvent mocks base method.

func (*MockCache) EXPECT

func (m *MockCache) EXPECT() *MockCacheMockRecorder

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

func (*MockCache) GetEvent

func (m *MockCache) GetEvent(ctx context.Context, shardID int32, key EventKey, firstEventID int64, branchToken []byte) (*v1.HistoryEvent, error)

GetEvent mocks base method.

func (*MockCache) PutEvent

func (m *MockCache) PutEvent(key EventKey, event *v1.HistoryEvent)

PutEvent mocks base method.

type MockCacheMockRecorder

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

MockCacheMockRecorder is the mock recorder for MockCache.

func (*MockCacheMockRecorder) DeleteEvent

func (mr *MockCacheMockRecorder) DeleteEvent(key interface{}) *gomock.Call

DeleteEvent indicates an expected call of DeleteEvent.

func (*MockCacheMockRecorder) GetEvent

func (mr *MockCacheMockRecorder) GetEvent(ctx, shardID, key, firstEventID, branchToken interface{}) *gomock.Call

GetEvent indicates an expected call of GetEvent.

func (*MockCacheMockRecorder) PutEvent

func (mr *MockCacheMockRecorder) PutEvent(key, event interface{}) *gomock.Call

PutEvent indicates an expected call of PutEvent.

type Notification

type Notification struct {
	ID                     definition.WorkflowKey
	LastFirstEventID       int64
	LastFirstEventTxnID    int64
	NextEventID            int64
	PreviousStartedEventID int64
	Timestamp              time.Time
	WorkflowState          enumsspb.WorkflowExecutionState
	WorkflowStatus         enumspb.WorkflowExecutionStatus
	VersionHistories       *historyspb.VersionHistories
}

func NewNotification

func NewNotification(
	namespaceID string,
	workflowExecution *commonpb.WorkflowExecution,
	lastFirstEventID int64,
	lastFirstEventTxnID int64,
	nextEventID int64,
	previousStartedEventID int64,
	workflowState enumsspb.WorkflowExecutionState,
	workflowStatus enumspb.WorkflowExecutionStatus,
	versionHistories *historyspb.VersionHistories,
) *Notification

type Notifier

type Notifier interface {
	NotifyNewHistoryEvent(event *Notification)
	WatchHistoryEvent(identifier definition.WorkflowKey) (string, chan *Notification, error)
	UnwatchHistoryEvent(identifier definition.WorkflowKey, subscriberID string) error
	Start()
	Stop()
}

type NotifierImpl

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

func NewNotifier

func NewNotifier(
	timeSource clock.TimeSource,
	metricsHandler metrics.Handler,
	workflowIDToShardID func(namespace.ID, string) int32,
) *NotifierImpl

func (*NotifierImpl) NotifyNewHistoryEvent

func (notifier *NotifierImpl) NotifyNewHistoryEvent(event *Notification)

func (*NotifierImpl) Start

func (notifier *NotifierImpl) Start()

func (*NotifierImpl) Stop

func (notifier *NotifierImpl) Stop()

func (*NotifierImpl) UnwatchHistoryEvent

func (notifier *NotifierImpl) UnwatchHistoryEvent(
	identifier definition.WorkflowKey, subscriberID string) error

func (*NotifierImpl) WatchHistoryEvent

func (notifier *NotifierImpl) WatchHistoryEvent(
	identifier definition.WorkflowKey) (string, chan *Notification, error)

Jump to

Keyboard shortcuts

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