example

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IterationCount uint64
View Source
var Limiter = smsync.NewFixedSemaphore(1000, "global")

Functions

func NewVMObjectSM

func NewVMObjectSM(objKey longbits.ByteString) *vmObjectSM

Types

type ArtifactBinary

type ArtifactBinary interface {
	GetReference() reference.Global
	GetCacheId() ArtifactCacheID
}

type ArtifactCacheID

type ArtifactCacheID string

type ArtifactCacheService

type ArtifactCacheService interface {
	Set(objectID reference.Local, object []byte) ArtifactCacheID
	SetRandomID(object []byte) (ArtifactCacheID, error)
	Get(id ArtifactCacheID) ([]byte, bool)
}

type ArtifactCacheServiceAdapter

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

func CreateArtifactCacheService

func CreateArtifactCacheService() *ArtifactCacheServiceAdapter

func (*ArtifactCacheServiceAdapter) PrepareSync

type ArtifactClientService

type ArtifactClientService interface {
	GetLatestValidatedStateAndCode() (state, code ArtifactBinary)
}

type ArtifactClientServiceAdapter

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

func CreateArtifactClientService

func CreateArtifactClientService() *ArtifactClientServiceAdapter

func (*ArtifactClientServiceAdapter) PrepareSync

type CallResult

type CallResult interface {
}

type CatalogC

type CatalogC = *catalogC

func CreateCatalogC

func CreateCatalogC() CatalogC

type ContractCallType

type ContractCallType uint8
const (
	ContractCallMutable ContractCallType
	ContractCallImmutable
	ContractCallSaga
)

type ContractRunnerService

type ContractRunnerService interface {
	ClassifyCall(code ArtifactBinary, method string) ContractCallType
	CallImmutableMethod(code ArtifactBinary, method string, state ArtifactBinary) CallResult
}

type ContractRunnerServiceAdapter

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

func (*ContractRunnerServiceAdapter) PrepareSync

type CustomSharedState

type CustomSharedState struct {
	Mutex   smachine.SyncLink
	Text    string
	Counter int
	// contains filtered or unexported fields
}

func (*CustomSharedState) GetKey

type CustomSharedStateAccessor

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

func (CustomSharedStateAccessor) Prepare

type LocalObjectCatalog

type LocalObjectCatalog struct {
}

func (LocalObjectCatalog) GetOrCreate

func (LocalObjectCatalog) TryGet

type ObjectInfo

type ObjectInfo struct {
	ObjKey        longbits.ByteString
	IsReadyToWork bool

	ArtifactClient *ArtifactClientServiceAdapter
	ContractRunner *ContractRunnerServiceAdapter

	ObjectLatestValidState ArtifactBinary
	ObjectLatestValidCode  ArtifactBinary

	ImmutableExecute smachine.SyncLink
	MutableExecute   smachine.SyncLink
}

type ServiceA

type ServiceA interface {
	DoSomething(param string) string
	DoSomethingElse(param0 string, param1 int) (bool, string)
}

Actual service

type ServiceAdapterA

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

generated or provided adapter

func CreateServiceAdapterA

func CreateServiceAdapterA() *ServiceAdapterA

func (*ServiceAdapterA) PrepareAsync

func (*ServiceAdapterA) PrepareSync

func (a *ServiceAdapterA) PrepareSync(ctx smachine.ExecutionContext, fn func(svc ServiceA)) smachine.SyncCallRequester

type SharedObjectState

type SharedObjectState struct {
	SemaReadyToWork smachine.SyncLink
	ObjectInfo
}

type SharedObjectStateAccessor

type SharedObjectStateAccessor struct {
	smachine.SharedDataLink
}

func (SharedObjectStateAccessor) Prepare

type StateMachine1

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

func (*StateMachine1) GetStateMachineDeclaration

func (s *StateMachine1) GetStateMachineDeclaration() smachine.StateMachineDeclaration

func (*StateMachine1) Init

func (*StateMachine1) State1

func (*StateMachine1) State2

func (*StateMachine1) State2a

func (*StateMachine1) State3

func (*StateMachine1) State4

func (*StateMachine1) State5

func (*StateMachine1) State6

type StateMachine2

type StateMachine2 struct {
	smachine.StateMachineDeclTemplate

	Yield bool
	// contains filtered or unexported fields
}

func (StateMachine2) GetInitStateFor

func (StateMachine2) GetInitStateFor(sm smachine.StateMachine) smachine.InitFunc

func (*StateMachine2) GetStateMachineDeclaration

func (s *StateMachine2) GetStateMachineDeclaration() smachine.StateMachineDeclaration

func (*StateMachine2) Init

func (*StateMachine2) State0

type StateMachine3

type StateMachine3 struct {
	smachine.StateMachineDeclTemplate
	// contains filtered or unexported fields
}

func (StateMachine3) GetInitStateFor

func (StateMachine3) GetInitStateFor(sm smachine.StateMachine) smachine.InitFunc

func (*StateMachine3) GetStateMachineDeclaration

func (s *StateMachine3) GetStateMachineDeclaration() smachine.StateMachineDeclaration

func (*StateMachine3) GetSubroutineInitState

func (s *StateMachine3) GetSubroutineInitState(smachine.SubroutineStartContext) smachine.InitFunc

func (*StateMachine3) Init

func (*StateMachine3) State0

func (*StateMachine3) State1

type StateMachineCallRequest

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

func (*StateMachineCallRequest) GetStateMachineDeclaration

func (s *StateMachineCallRequest) GetStateMachineDeclaration() smachine.StateMachineDeclaration

func (*StateMachineCallRequest) Init

Jump to

Keyboard shortcuts

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