Documentation
¶
Overview ¶
Package cache is a generated GoMock package.
Index ¶
- Variables
- func ClearMutableState(cache Cache, key Key)
- func GetCurrentRunID(ctx context.Context, shardContext historyi.ShardContext, workflowCache Cache, ...) (runID string, retErr error)
- func GetMutableState(cache Cache, key Key) historyi.MutableState
- func PutContextIfNotExist(cache Cache, key Key, value historyi.WorkflowContext) error
- type Cache
- type Key
- type MockCache
- func (m *MockCache) EXPECT() *MockCacheMockRecorder
- func (m *MockCache) GetOrCreateChasmExecution(ctx context.Context, shardContext interfaces.ShardContext, ...) (interfaces.WorkflowContext, interfaces.ReleaseWorkflowContextFunc, error)
- func (m *MockCache) GetOrCreateCurrentExecution(ctx context.Context, shardContext interfaces.ShardContext, ...) (interfaces.ReleaseWorkflowContextFunc, error)
- func (m *MockCache) GetOrCreateWorkflowExecution(ctx context.Context, shardContext interfaces.ShardContext, ...) (interfaces.WorkflowContext, interfaces.ReleaseWorkflowContextFunc, error)
- type MockCacheMockRecorder
- func (mr *MockCacheMockRecorder) GetOrCreateChasmExecution(ctx, shardContext, namespaceID, execution, archetypeID, lockPriority any) *gomock.Call
- func (mr *MockCacheMockRecorder) GetOrCreateCurrentExecution(ctx, shardContext, namespaceID, workflowID, archetypeID, lockPriority any) *gomock.Call
- func (mr *MockCacheMockRecorder) GetOrCreateWorkflowExecution(ctx, shardContext, namespaceID, execution, lockPriority any) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
var Module = fx.Options( fx.Provide(NewHostLevelCache), fx.Invoke(func( lc fx.Lifecycle, cache Cache, ) { lc.Append(fx.Hook{ OnStop: func(_ context.Context) error { ci, ok := cache.(*cacheImpl) if ok { ci.stop() } return nil }, }) }), )
var NoopReleaseFn historyi.ReleaseWorkflowContextFunc = func(err error) {}
Functions ¶
func ClearMutableState ¶
ClearMutableState clears cached mutable state for the given key to force a reload from persistence on the next access.
func GetCurrentRunID ¶
func GetMutableState ¶
func GetMutableState(cache Cache, key Key) historyi.MutableState
GetMutableState returns the MutableState for the given key from the cache. Exported for testing purposes.
func PutContextIfNotExist ¶
func PutContextIfNotExist(cache Cache, key Key, value historyi.WorkflowContext) error
PutContextIfNotExist puts the given workflow Context into the cache, if it doens't already exist. Exported for testing purposes.
Types ¶
type Cache ¶
type Cache interface {
GetOrCreateCurrentExecution(
ctx context.Context,
shardContext historyi.ShardContext,
namespaceID namespace.ID,
workflowID string,
archetypeID chasm.ArchetypeID,
lockPriority locks.Priority,
) (historyi.ReleaseWorkflowContextFunc, error)
GetOrCreateWorkflowExecution(
ctx context.Context,
shardContext historyi.ShardContext,
namespaceID namespace.ID,
execution *commonpb.WorkflowExecution,
lockPriority locks.Priority,
) (historyi.WorkflowContext, historyi.ReleaseWorkflowContextFunc, error)
GetOrCreateChasmExecution(
ctx context.Context,
shardContext historyi.ShardContext,
namespaceID namespace.ID,
execution *commonpb.WorkflowExecution,
archetypeID chasm.ArchetypeID,
lockPriority locks.Priority,
) (historyi.WorkflowContext, historyi.ReleaseWorkflowContextFunc, error)
}
type Key ¶
type Key struct {
// Those are exported because some unit tests uses the cache directly.
// TODO: Update the unit tests and make those fields private.
WorkflowKey definition.WorkflowKey
ArchetypeID chasm.ArchetypeID
ShardUUID string
}
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) GetOrCreateChasmExecution ¶
func (m *MockCache) GetOrCreateChasmExecution(ctx context.Context, shardContext interfaces.ShardContext, namespaceID namespace.ID, execution *common.WorkflowExecution, archetypeID chasm.ArchetypeID, lockPriority locks.Priority) (interfaces.WorkflowContext, interfaces.ReleaseWorkflowContextFunc, error)
GetOrCreateChasmExecution mocks base method.
func (*MockCache) GetOrCreateCurrentExecution ¶
func (m *MockCache) GetOrCreateCurrentExecution(ctx context.Context, shardContext interfaces.ShardContext, namespaceID namespace.ID, workflowID string, archetypeID chasm.ArchetypeID, lockPriority locks.Priority) (interfaces.ReleaseWorkflowContextFunc, error)
GetOrCreateCurrentExecution mocks base method.
func (*MockCache) GetOrCreateWorkflowExecution ¶
func (m *MockCache) GetOrCreateWorkflowExecution(ctx context.Context, shardContext interfaces.ShardContext, namespaceID namespace.ID, execution *common.WorkflowExecution, lockPriority locks.Priority) (interfaces.WorkflowContext, interfaces.ReleaseWorkflowContextFunc, error)
GetOrCreateWorkflowExecution mocks base method.
type MockCacheMockRecorder ¶
type MockCacheMockRecorder struct {
// contains filtered or unexported fields
}
MockCacheMockRecorder is the mock recorder for MockCache.
func (*MockCacheMockRecorder) GetOrCreateChasmExecution ¶
func (mr *MockCacheMockRecorder) GetOrCreateChasmExecution(ctx, shardContext, namespaceID, execution, archetypeID, lockPriority any) *gomock.Call
GetOrCreateChasmExecution indicates an expected call of GetOrCreateChasmExecution.
func (*MockCacheMockRecorder) GetOrCreateCurrentExecution ¶
func (mr *MockCacheMockRecorder) GetOrCreateCurrentExecution(ctx, shardContext, namespaceID, workflowID, archetypeID, lockPriority any) *gomock.Call
GetOrCreateCurrentExecution indicates an expected call of GetOrCreateCurrentExecution.
func (*MockCacheMockRecorder) GetOrCreateWorkflowExecution ¶
func (mr *MockCacheMockRecorder) GetOrCreateWorkflowExecution(ctx, shardContext, namespaceID, execution, lockPriority any) *gomock.Call
GetOrCreateWorkflowExecution indicates an expected call of GetOrCreateWorkflowExecution.