object

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const UnorderedMaxParallelism = 30

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog interface {
	Get(ctx smachine.ExecutionContext, objectReference reference.Global) SharedStateAccessor
	TryGet(ctx smachine.ExecutionContext, objectReference reference.Global) (SharedStateAccessor, bool)
	Create(ctx smachine.ExecutionContext, objectReference reference.Global) SharedStateAccessor
	GetOrCreate(ctx smachine.ExecutionContext, objectReference reference.Global) SharedStateAccessor
}

type CatalogMock

type CatalogMock struct {
	CreateMock mCatalogMockCreate

	GetMock mCatalogMockGet

	GetOrCreateMock mCatalogMockGetOrCreate

	TryGetMock mCatalogMockTryGet
	// contains filtered or unexported fields
}

CatalogMock implements Catalog

func NewCatalogMock

func NewCatalogMock(t minimock.Tester) *CatalogMock

NewCatalogMock returns a mock for Catalog

func (*CatalogMock) Create

func (mmCreate *CatalogMock) Create(e1 smachine.ExecutionContext, objectReference reference.Global) (s1 SharedStateAccessor)

Create implements Catalog

func (*CatalogMock) CreateAfterCounter

func (mmCreate *CatalogMock) CreateAfterCounter() uint64

CreateAfterCounter returns a count of finished CatalogMock.Create invocations

func (*CatalogMock) CreateBeforeCounter

func (mmCreate *CatalogMock) CreateBeforeCounter() uint64

CreateBeforeCounter returns a count of CatalogMock.Create invocations

func (*CatalogMock) Get

func (mmGet *CatalogMock) Get(e1 smachine.ExecutionContext, objectReference reference.Global) (s1 SharedStateAccessor)

Get implements Catalog

func (*CatalogMock) GetAfterCounter

func (mmGet *CatalogMock) GetAfterCounter() uint64

GetAfterCounter returns a count of finished CatalogMock.Get invocations

func (*CatalogMock) GetBeforeCounter

func (mmGet *CatalogMock) GetBeforeCounter() uint64

GetBeforeCounter returns a count of CatalogMock.Get invocations

func (*CatalogMock) GetOrCreate

func (mmGetOrCreate *CatalogMock) GetOrCreate(e1 smachine.ExecutionContext, objectReference reference.Global) (s1 SharedStateAccessor)

GetOrCreate implements Catalog

func (*CatalogMock) GetOrCreateAfterCounter

func (mmGetOrCreate *CatalogMock) GetOrCreateAfterCounter() uint64

GetOrCreateAfterCounter returns a count of finished CatalogMock.GetOrCreate invocations

func (*CatalogMock) GetOrCreateBeforeCounter

func (mmGetOrCreate *CatalogMock) GetOrCreateBeforeCounter() uint64

GetOrCreateBeforeCounter returns a count of CatalogMock.GetOrCreate invocations

func (*CatalogMock) MinimockCreateDone

func (m *CatalogMock) MinimockCreateDone() bool

MinimockCreateDone returns true if the count of the Create invocations corresponds the number of defined expectations

func (*CatalogMock) MinimockCreateInspect

func (m *CatalogMock) MinimockCreateInspect()

MinimockCreateInspect logs each unmet expectation

func (*CatalogMock) MinimockFinish

func (m *CatalogMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*CatalogMock) MinimockGetDone

func (m *CatalogMock) MinimockGetDone() bool

MinimockGetDone returns true if the count of the Get invocations corresponds the number of defined expectations

func (*CatalogMock) MinimockGetInspect

func (m *CatalogMock) MinimockGetInspect()

MinimockGetInspect logs each unmet expectation

func (*CatalogMock) MinimockGetOrCreateDone

func (m *CatalogMock) MinimockGetOrCreateDone() bool

MinimockGetOrCreateDone returns true if the count of the GetOrCreate invocations corresponds the number of defined expectations

func (*CatalogMock) MinimockGetOrCreateInspect

func (m *CatalogMock) MinimockGetOrCreateInspect()

MinimockGetOrCreateInspect logs each unmet expectation

func (*CatalogMock) MinimockTryGetDone

func (m *CatalogMock) MinimockTryGetDone() bool

MinimockTryGetDone returns true if the count of the TryGet invocations corresponds the number of defined expectations

func (*CatalogMock) MinimockTryGetInspect

func (m *CatalogMock) MinimockTryGetInspect()

MinimockTryGetInspect logs each unmet expectation

func (*CatalogMock) MinimockWait

func (m *CatalogMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*CatalogMock) TryGet

func (mmTryGet *CatalogMock) TryGet(e1 smachine.ExecutionContext, objectReference reference.Global) (s1 SharedStateAccessor, b1 bool)

TryGet implements Catalog

func (*CatalogMock) TryGetAfterCounter

func (mmTryGet *CatalogMock) TryGetAfterCounter() uint64

TryGetAfterCounter returns a count of finished CatalogMock.TryGet invocations

func (*CatalogMock) TryGetBeforeCounter

func (mmTryGet *CatalogMock) TryGetBeforeCounter() uint64

TryGetBeforeCounter returns a count of CatalogMock.TryGet invocations

type CatalogMockAccessType

type CatalogMockAccessType int
const (
	CatalogMockAccessGetOrCreate CatalogMockAccessType = iota
	CatalogMockAccessTryGet
)

type CatalogMockCreateExpectation

type CatalogMockCreateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CatalogMockCreateExpectation specifies expectation struct of the Catalog.Create

func (*CatalogMockCreateExpectation) Then

Then sets up Catalog.Create return parameters for the expectation previously defined by the When method

type CatalogMockCreateParams

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

CatalogMockCreateParams contains parameters of the Catalog.Create

type CatalogMockCreateResults

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

CatalogMockCreateResults contains results of the Catalog.Create

type CatalogMockGetExpectation

type CatalogMockGetExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CatalogMockGetExpectation specifies expectation struct of the Catalog.Get

func (*CatalogMockGetExpectation) Then

Then sets up Catalog.Get return parameters for the expectation previously defined by the When method

type CatalogMockGetOrCreateExpectation

type CatalogMockGetOrCreateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CatalogMockGetOrCreateExpectation specifies expectation struct of the Catalog.GetOrCreate

func (*CatalogMockGetOrCreateExpectation) Then

Then sets up Catalog.GetOrCreate return parameters for the expectation previously defined by the When method

type CatalogMockGetOrCreateParams

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

CatalogMockGetOrCreateParams contains parameters of the Catalog.GetOrCreate

type CatalogMockGetOrCreateResults

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

CatalogMockGetOrCreateResults contains results of the Catalog.GetOrCreate

type CatalogMockGetParams

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

CatalogMockGetParams contains parameters of the Catalog.Get

type CatalogMockGetResults

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

CatalogMockGetResults contains results of the Catalog.Get

type CatalogMockTryGetExpectation

type CatalogMockTryGetExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CatalogMockTryGetExpectation specifies expectation struct of the Catalog.TryGet

func (*CatalogMockTryGetExpectation) Then

Then sets up Catalog.TryGet return parameters for the expectation previously defined by the When method

type CatalogMockTryGetParams

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

CatalogMockTryGetParams contains parameters of the Catalog.TryGet

type CatalogMockTryGetResults

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

CatalogMockTryGetResults contains results of the Catalog.TryGet

type CatalogMockWrapper

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

func NewCatalogMockWrapper

func NewCatalogMockWrapper(t minimock.Tester) *CatalogMockWrapper

func (*CatalogMockWrapper) AddObject

func (m *CatalogMockWrapper) AddObject(objectRef reference.Global, objectAccessor SharedStateAccessor) *CatalogMockWrapper

func (*CatalogMockWrapper) AllowAccessMode

func (m *CatalogMockWrapper) AllowAccessMode(mode CatalogMockAccessType)

func (*CatalogMockWrapper) CheckDone

func (m *CatalogMockWrapper) CheckDone() error

func (*CatalogMockWrapper) Mock

func (m *CatalogMockWrapper) Mock() *CatalogMock

type Info

type Info struct {
	Reference reference.Global

	UnorderedExecute           smachine.SyncLink
	OrderedExecute             smachine.SyncLink
	ReadyToWork                smachine.SyncLink
	SummaryDone                smachine.SyncLink
	PendingConstructorFinished smachine.SyncLink

	SignalOrderedPendingFinished smachine.BargeInWithParam

	// KnownRequests holds requests that were seen on current pulse
	KnownRequests callregistry.WorkingTable
	// PendingTable holds requests that are known to be processed by other executors
	PendingTable callregistry.PendingTable

	PreviousExecutorUnorderedPendingCount uint8
	PreviousExecutorOrderedPendingCount   uint8

	UnorderedPendingEarliestPulse pulse.Number
	OrderedPendingEarliestPulse   pulse.Number

	Transcript validation.Transcript
	// contains filtered or unexported fields
}

func (*Info) BuildLatestDirtyState

func (i *Info) BuildLatestDirtyState() *rms.ObjectState

func (*Info) BuildStateReport

func (i *Info) BuildStateReport() rms.VStateReport

func (*Info) DescriptorDirty

func (i *Info) DescriptorDirty() descriptor.Object

func (*Info) DescriptorValidated

func (i *Info) DescriptorValidated() descriptor.Object

func (*Info) FinishRequest

func (i *Info) FinishRequest(
	isolation contract.MethodIsolation,
	requestRef reference.Global,
	result *rms.VCallResult,
)

func (Info) GetEarliestPulse

func (i Info) GetEarliestPulse(tolerance isolation.InterferenceFlag) pulse.Number

func (*Info) GetState

func (i *Info) GetState() State

func (*Info) IsReady

func (i *Info) IsReady() bool

func (*Info) SetDescriptorDirty

func (i *Info) SetDescriptorDirty(objectDescriptor descriptor.Object)

func (*Info) SetDescriptorValidated

func (i *Info) SetDescriptorValidated(objectDescriptor descriptor.Object)

func (*Info) SetState

func (i *Info) SetState(state State)

type LocalCatalog

type LocalCatalog struct{}

func NewLocalCatalog

func NewLocalCatalog() *LocalCatalog

func (LocalCatalog) Create

func (LocalCatalog) Get

func (LocalCatalog) GetOrCreate

func (p LocalCatalog) GetOrCreate(ctx smachine.ExecutionContext, objectReference reference.Global) SharedStateAccessor

func (LocalCatalog) TryGet

type SMObject

type SMObject struct {
	smachine.StateMachineDeclTemplate

	SharedState
	// contains filtered or unexported fields
}

func NewStateMachineObject

func NewStateMachineObject(objectReference reference.Global) *SMObject

func (*SMObject) GetInitStateFor

func (sm *SMObject) GetInitStateFor(smachine.StateMachine) smachine.InitFunc

func (*SMObject) GetStateMachineDeclaration

func (sm *SMObject) GetStateMachineDeclaration() smachine.StateMachineDeclaration

func (*SMObject) Init

func (*SMObject) InjectDependencies

func (sm *SMObject) InjectDependencies(stateMachine smachine.StateMachine, _ smachine.SlotLink, injector injector.DependencyInjector)

type SharedState

type SharedState struct {
	Info
}

type SharedStateAccessor

type SharedStateAccessor struct {
	smachine.SharedDataLink
}

func (SharedStateAccessor) Prepare

func (SharedStateAccessor) PrepareAndWakeUp

func (v SharedStateAccessor) PrepareAndWakeUp(fn func(*SharedState)) smachine.SharedDataAccessor

type State

type State int32
const (
	Unknown State = iota
	Missing
	Inactive
	Empty
	HasState
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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