events

package
v1.2.14-prerelease12 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package events is a generated GoMock package.

Package events is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	GetEvent(
		ctx context.Context,
		shardID int,
		domainID string,
		workflowID string,
		runID string,
		firstEventID int64,
		eventID int64,
		branchToken []byte,
	) (*types.HistoryEvent, error)
	PutEvent(
		domainID string,
		workflowID string,
		runID string,
		eventID int64,
		event *types.HistoryEvent,
	)
}

Cache caches workflow history event

func NewCache

func NewCache(
	shardID int,
	historyManager persistence.HistoryManager,
	config *config.Config,
	logger log.Logger,
	metricsClient metrics.Client,
	domainCache cache.DomainCache,
) Cache

NewCache creates a new events cache

func NewGlobalCache

func NewGlobalCache(
	initialCount int,
	maxCount int,
	ttl time.Duration,
	historyManager persistence.HistoryManager,
	logger log.Logger,
	metricsClient metrics.Client,
	maxSize uint64,
	domainCache cache.DomainCache,
) Cache

NewGlobalCache creates a new global events cache

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) 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 int, domainID, workflowID, runID string, firstEventID, eventID int64, branchToken []byte) (*types.HistoryEvent, error)

GetEvent mocks base method.

func (*MockCache) PutEvent

func (m *MockCache) PutEvent(domainID, workflowID, runID string, eventID int64, event *types.HistoryEvent)

PutEvent mocks base method.

type MockCacheMockRecorder

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

MockCacheMockRecorder is the mock recorder for MockCache.

func (*MockCacheMockRecorder) GetEvent

func (mr *MockCacheMockRecorder) GetEvent(ctx, shardID, domainID, workflowID, runID, firstEventID, eventID, branchToken interface{}) *gomock.Call

GetEvent indicates an expected call of GetEvent.

func (*MockCacheMockRecorder) PutEvent

func (mr *MockCacheMockRecorder) PutEvent(domainID, workflowID, runID, eventID, event interface{}) *gomock.Call

PutEvent indicates an expected call of PutEvent.

type MockNotifier added in v1.2.9

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

MockNotifier is a mock of Notifier interface.

func NewMockNotifier added in v1.2.9

func NewMockNotifier(ctrl *gomock.Controller) *MockNotifier

NewMockNotifier creates a new mock instance.

func (*MockNotifier) EXPECT added in v1.2.9

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

func (*MockNotifier) NotifyNewHistoryEvent added in v1.2.9

func (m *MockNotifier) NotifyNewHistoryEvent(event *Notification)

NotifyNewHistoryEvent mocks base method.

func (*MockNotifier) Start added in v1.2.9

func (m *MockNotifier) Start()

Start mocks base method.

func (*MockNotifier) Stop added in v1.2.9

func (m *MockNotifier) Stop()

Stop mocks base method.

func (*MockNotifier) UnwatchHistoryEvent added in v1.2.9

func (m *MockNotifier) UnwatchHistoryEvent(identifier definition.WorkflowIdentifier, subscriberID string) error

UnwatchHistoryEvent mocks base method.

func (*MockNotifier) WatchHistoryEvent added in v1.2.9

func (m *MockNotifier) WatchHistoryEvent(identifier definition.WorkflowIdentifier) (string, chan *Notification, error)

WatchHistoryEvent mocks base method.

type MockNotifierMockRecorder added in v1.2.9

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

MockNotifierMockRecorder is the mock recorder for MockNotifier.

func (*MockNotifierMockRecorder) NotifyNewHistoryEvent added in v1.2.9

func (mr *MockNotifierMockRecorder) NotifyNewHistoryEvent(event interface{}) *gomock.Call

NotifyNewHistoryEvent indicates an expected call of NotifyNewHistoryEvent.

func (*MockNotifierMockRecorder) Start added in v1.2.9

func (mr *MockNotifierMockRecorder) Start() *gomock.Call

Start indicates an expected call of Start.

func (*MockNotifierMockRecorder) Stop added in v1.2.9

func (mr *MockNotifierMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop.

func (*MockNotifierMockRecorder) UnwatchHistoryEvent added in v1.2.9

func (mr *MockNotifierMockRecorder) UnwatchHistoryEvent(identifier, subscriberID interface{}) *gomock.Call

UnwatchHistoryEvent indicates an expected call of UnwatchHistoryEvent.

func (*MockNotifierMockRecorder) WatchHistoryEvent added in v1.2.9

func (mr *MockNotifierMockRecorder) WatchHistoryEvent(identifier interface{}) *gomock.Call

WatchHistoryEvent indicates an expected call of WatchHistoryEvent.

type Notification

type Notification struct {
	ID                     definition.WorkflowIdentifier
	LastFirstEventID       int64
	NextEventID            int64
	PreviousStartedEventID int64
	Timestamp              time.Time
	CurrentBranchToken     []byte
	WorkflowState          int
	WorkflowCloseState     int
}

Notification is the notification for new history events

func NewNotification

func NewNotification(
	domainID string,
	workflowExecution *types.WorkflowExecution,
	lastFirstEventID int64,
	nextEventID int64,
	previousStartedEventID int64,
	currentBranchToken []byte,
	workflowState int,
	workflowCloseState int,
) *Notification

NewNotification creates a new history event notification

type Notifier

type Notifier interface {
	common.Daemon
	NotifyNewHistoryEvent(event *Notification)
	WatchHistoryEvent(identifier definition.WorkflowIdentifier) (string, chan *Notification, error)
	UnwatchHistoryEvent(identifier definition.WorkflowIdentifier, subscriberID string) error
}

Notifier is a pub-sub for sending and receiving notifications on new history events

func NewNotifier

func NewNotifier(
	timeSource clock.TimeSource,
	metrics metrics.Client,
	workflowIDToShardID func(string) int,
) Notifier

NewNotifier creates a new history event notifier

type PersistedBlob added in v0.25.0

type PersistedBlob struct {
	persistence.DataBlob

	BranchToken  []byte
	FirstEventID int64
}

PersistedBlob is a wrapper on persistence.DataBlob with additional field indicating what was persisted. Additional fields are used as an identification key among other blobs.

type PersistedBlobs added in v0.25.0

type PersistedBlobs []PersistedBlob

PersistedBlobs is a slice of PersistedBlob

func (PersistedBlobs) Find added in v0.25.0

func (blobs PersistedBlobs) Find(branchToken []byte, firstEventID int64) *persistence.DataBlob

Find searches for persisted event blob. Returns nil when not found.

Jump to

Keyboard shortcuts

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