core

package
v0.0.0-...-bef5c4b Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	AgentStartedStateName        = "Started"
	AgentRegisteredStateName     = "Registered"
	AgentReadyStateName          = "Ready"
	AgentRunningStateName        = "Running"
	AgentInitErrorStateName      = "InitError"
	AgentExitErrorStateName      = "ExitError"
	AgentShutdownFailedStateName = "ShutdownFailed"
	AgentExitedStateName         = "Exited"
	AgentLaunchErrorName         = "LaunchError"
)
View Source
const (
	RuntimeStartedStateName   = "Started"
	RuntimeInitErrorStateName = "InitError"
	RuntimeReadyStateName     = "Ready"
	RuntimeRunningStateName   = "Running"
)
View Source
const MaxAgentsAllowed = 10

Variables

View Source
var ErrAgentIDCollision = errors.New("ErrAgentIDCollision")
View Source
var ErrAgentNameCollision = errors.New("ErrAgentNameCollision")
View Source
var ErrConcurrentStateModification = errors.New("concurrent state modification")
View Source
var ErrGateCanceled = errors.New("ErrGateCanceled")
View Source
var ErrGateIntegrity = errors.New("ErrGateIntegrity")
View Source
var ErrNotAllowed = errors.New("state transition is not allowed")
View Source
var ErrRegistrationServiceOff = errors.New("ErrRegistrationServiceOff")
View Source
var ErrTooManyExtensions = errors.New("ErrTooManyExtensions")

Functions

func MapErrorToAgentInfoErrorType

func MapErrorToAgentInfoErrorType(err error) model.ErrorType

func ValidateExternalAgentEvent

func ValidateExternalAgentEvent(e Event) error

Types

type Agent

type Agent interface {
	*ExternalAgent | *InternalAgent
	Name() string
	ID() uuid.UUID
}

type AgentInfo

type AgentInfo struct {
	Name          string
	State         string
	Subscriptions []string
	ErrorType     model.ErrorType
}

type AgentsMap

type AgentsMap[T Agent] struct {
	// contains filtered or unexported fields
}

func NewAgentsMap

func NewAgentsMap[T Agent]() AgentsMap[T]

func (*AgentsMap[T]) Clear

func (m *AgentsMap[T]) Clear()

func (*AgentsMap[T]) FindByID

func (m *AgentsMap[T]) FindByID(id uuid.UUID) (agent T, found bool)

func (*AgentsMap[T]) FindByName

func (m *AgentsMap[T]) FindByName(name string) (agent T, found bool)

func (*AgentsMap[T]) Insert

func (m *AgentsMap[T]) Insert(a T) error

func (*AgentsMap[T]) Size

func (m *AgentsMap[T]) Size() int

func (*AgentsMap[T]) Visit

func (m *AgentsMap[T]) Visit(cb func(T))

type Event

type Event string
const (
	ShutdownEvent Event = "SHUTDOWN"
)

type ExternalAgent

type ExternalAgent struct {
	ManagedThread Suspendable

	StartedState        ExternalAgentState
	RegisteredState     ExternalAgentState
	ReadyState          ExternalAgentState
	RunningState        ExternalAgentState
	InitErrorState      ExternalAgentState
	ExitErrorState      ExternalAgentState
	ShutdownFailedState ExternalAgentState
	ExitedState         ExternalAgentState
	LaunchErrorState    ExternalAgentState
	// contains filtered or unexported fields
}

func NewExternalAgent

func NewExternalAgent(name string, initFlow InitFlowSynchronization) *ExternalAgent

func (*ExternalAgent) ErrorType

func (s *ExternalAgent) ErrorType() model.ErrorType

func (*ExternalAgent) ExitError

func (s *ExternalAgent) ExitError(errorType model.ErrorType) error

func (*ExternalAgent) Exited

func (s *ExternalAgent) Exited() error

func (*ExternalAgent) GetAgentDescription

func (s *ExternalAgent) GetAgentDescription() statejson.ExtensionDescription

func (*ExternalAgent) GetState

func (s *ExternalAgent) GetState() ExternalAgentState

func (*ExternalAgent) ID

func (s *ExternalAgent) ID() uuid.UUID

func (*ExternalAgent) InitError

func (s *ExternalAgent) InitError(errorType model.ErrorType) error

func (*ExternalAgent) IsSubscribed

func (s *ExternalAgent) IsSubscribed(e Event) bool

func (*ExternalAgent) LaunchError

func (s *ExternalAgent) LaunchError(err model.ErrorType) error

func (*ExternalAgent) Name

func (s *ExternalAgent) Name() string

func (*ExternalAgent) Ready

func (s *ExternalAgent) Ready() error

func (*ExternalAgent) Register

func (s *ExternalAgent) Register(events []Event) error

func (*ExternalAgent) Release

func (s *ExternalAgent) Release()

func (*ExternalAgent) SetState

func (s *ExternalAgent) SetState(state ExternalAgentState)

func (*ExternalAgent) ShutdownFailed

func (s *ExternalAgent) ShutdownFailed() error

func (*ExternalAgent) String

func (s *ExternalAgent) String() string

func (*ExternalAgent) SubscribedEvents

func (s *ExternalAgent) SubscribedEvents() []string

func (*ExternalAgent) SuspendUnsafe

func (s *ExternalAgent) SuspendUnsafe()

type ExternalAgentExitErrorState

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

func (*ExternalAgentExitErrorState) ExitError

func (s *ExternalAgentExitErrorState) ExitError(errorType model.ErrorType) error

func (*ExternalAgentExitErrorState) Exited

func (s *ExternalAgentExitErrorState) Exited() error

func (*ExternalAgentExitErrorState) InitError

func (s *ExternalAgentExitErrorState) InitError(errorType model.ErrorType) error

func (*ExternalAgentExitErrorState) LaunchError

func (s *ExternalAgentExitErrorState) LaunchError(model.ErrorType) error

func (*ExternalAgentExitErrorState) Name

func (*ExternalAgentExitErrorState) Ready

func (s *ExternalAgentExitErrorState) Ready() error

func (*ExternalAgentExitErrorState) Register

func (s *ExternalAgentExitErrorState) Register(events []Event) error

func (*ExternalAgentExitErrorState) ShutdownFailed

func (s *ExternalAgentExitErrorState) ShutdownFailed() error

type ExternalAgentExitedState

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

func (*ExternalAgentExitedState) ExitError

func (s *ExternalAgentExitedState) ExitError(errorType model.ErrorType) error

func (*ExternalAgentExitedState) Exited

func (s *ExternalAgentExitedState) Exited() error

func (*ExternalAgentExitedState) InitError

func (s *ExternalAgentExitedState) InitError(errorType model.ErrorType) error

func (*ExternalAgentExitedState) LaunchError

func (s *ExternalAgentExitedState) LaunchError(model.ErrorType) error

func (*ExternalAgentExitedState) Name

func (s *ExternalAgentExitedState) Name() string

func (*ExternalAgentExitedState) Ready

func (s *ExternalAgentExitedState) Ready() error

func (*ExternalAgentExitedState) Register

func (s *ExternalAgentExitedState) Register(events []Event) error

func (*ExternalAgentExitedState) ShutdownFailed

func (s *ExternalAgentExitedState) ShutdownFailed() error

type ExternalAgentInitErrorState

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

func (*ExternalAgentInitErrorState) ExitError

func (s *ExternalAgentInitErrorState) ExitError(errorType model.ErrorType) error

func (*ExternalAgentInitErrorState) Exited

func (s *ExternalAgentInitErrorState) Exited() error

func (*ExternalAgentInitErrorState) InitError

func (s *ExternalAgentInitErrorState) InitError(errorType model.ErrorType) error

func (*ExternalAgentInitErrorState) LaunchError

func (s *ExternalAgentInitErrorState) LaunchError(model.ErrorType) error

func (*ExternalAgentInitErrorState) Name

func (*ExternalAgentInitErrorState) Ready

func (s *ExternalAgentInitErrorState) Ready() error

func (*ExternalAgentInitErrorState) Register

func (s *ExternalAgentInitErrorState) Register(events []Event) error

func (*ExternalAgentInitErrorState) ShutdownFailed

func (s *ExternalAgentInitErrorState) ShutdownFailed() error

type ExternalAgentLaunchErrorState

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

func (*ExternalAgentLaunchErrorState) ExitError

func (s *ExternalAgentLaunchErrorState) ExitError(errorType model.ErrorType) error

func (*ExternalAgentLaunchErrorState) Exited

func (s *ExternalAgentLaunchErrorState) Exited() error

func (*ExternalAgentLaunchErrorState) InitError

func (s *ExternalAgentLaunchErrorState) InitError(errorType model.ErrorType) error

func (*ExternalAgentLaunchErrorState) LaunchError

func (s *ExternalAgentLaunchErrorState) LaunchError(model.ErrorType) error

func (*ExternalAgentLaunchErrorState) Name

func (*ExternalAgentLaunchErrorState) Ready

func (s *ExternalAgentLaunchErrorState) Ready() error

func (*ExternalAgentLaunchErrorState) Register

func (s *ExternalAgentLaunchErrorState) Register(events []Event) error

func (*ExternalAgentLaunchErrorState) ShutdownFailed

func (s *ExternalAgentLaunchErrorState) ShutdownFailed() error

type ExternalAgentReadyState

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

func (*ExternalAgentReadyState) ExitError

func (s *ExternalAgentReadyState) ExitError(errorType model.ErrorType) error

func (*ExternalAgentReadyState) Exited

func (s *ExternalAgentReadyState) Exited() error

func (*ExternalAgentReadyState) InitError

func (s *ExternalAgentReadyState) InitError(errorType model.ErrorType) error

func (*ExternalAgentReadyState) LaunchError

func (s *ExternalAgentReadyState) LaunchError(model.ErrorType) error

func (*ExternalAgentReadyState) Name

func (s *ExternalAgentReadyState) Name() string

func (*ExternalAgentReadyState) Ready

func (s *ExternalAgentReadyState) Ready() error

func (*ExternalAgentReadyState) Register

func (s *ExternalAgentReadyState) Register(events []Event) error

func (*ExternalAgentReadyState) ShutdownFailed

func (s *ExternalAgentReadyState) ShutdownFailed() error

type ExternalAgentRegisteredState

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

func (*ExternalAgentRegisteredState) ExitError

func (s *ExternalAgentRegisteredState) ExitError(errorType model.ErrorType) error

func (*ExternalAgentRegisteredState) Exited

func (s *ExternalAgentRegisteredState) Exited() error

func (*ExternalAgentRegisteredState) InitError

func (s *ExternalAgentRegisteredState) InitError(errorType model.ErrorType) error

func (*ExternalAgentRegisteredState) LaunchError

func (s *ExternalAgentRegisteredState) LaunchError(model.ErrorType) error

func (*ExternalAgentRegisteredState) Name

func (*ExternalAgentRegisteredState) Ready

func (*ExternalAgentRegisteredState) Register

func (s *ExternalAgentRegisteredState) Register(events []Event) error

func (*ExternalAgentRegisteredState) ShutdownFailed

func (s *ExternalAgentRegisteredState) ShutdownFailed() error

type ExternalAgentRunningState

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

func (*ExternalAgentRunningState) ExitError

func (s *ExternalAgentRunningState) ExitError(errorType model.ErrorType) error

func (*ExternalAgentRunningState) Exited

func (s *ExternalAgentRunningState) Exited() error

func (*ExternalAgentRunningState) InitError

func (s *ExternalAgentRunningState) InitError(errorType model.ErrorType) error

func (*ExternalAgentRunningState) LaunchError

func (s *ExternalAgentRunningState) LaunchError(model.ErrorType) error

func (*ExternalAgentRunningState) Name

func (*ExternalAgentRunningState) Ready

func (s *ExternalAgentRunningState) Ready() error

func (*ExternalAgentRunningState) Register

func (s *ExternalAgentRunningState) Register(events []Event) error

func (*ExternalAgentRunningState) ShutdownFailed

func (s *ExternalAgentRunningState) ShutdownFailed() error

type ExternalAgentShutdownFailedState

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

func (*ExternalAgentShutdownFailedState) ExitError

func (s *ExternalAgentShutdownFailedState) ExitError(errorType model.ErrorType) error

func (*ExternalAgentShutdownFailedState) Exited

func (s *ExternalAgentShutdownFailedState) Exited() error

func (*ExternalAgentShutdownFailedState) InitError

func (s *ExternalAgentShutdownFailedState) InitError(errorType model.ErrorType) error

func (*ExternalAgentShutdownFailedState) LaunchError

func (s *ExternalAgentShutdownFailedState) LaunchError(model.ErrorType) error

func (*ExternalAgentShutdownFailedState) Name

func (*ExternalAgentShutdownFailedState) Ready

func (s *ExternalAgentShutdownFailedState) Ready() error

func (*ExternalAgentShutdownFailedState) Register

func (s *ExternalAgentShutdownFailedState) Register(events []Event) error

func (*ExternalAgentShutdownFailedState) ShutdownFailed

func (s *ExternalAgentShutdownFailedState) ShutdownFailed() error

type ExternalAgentStartedState

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

func (*ExternalAgentStartedState) ExitError

func (s *ExternalAgentStartedState) ExitError(errorType model.ErrorType) error

func (*ExternalAgentStartedState) Exited

func (s *ExternalAgentStartedState) Exited() error

func (*ExternalAgentStartedState) InitError

func (s *ExternalAgentStartedState) InitError(errorType model.ErrorType) error

func (*ExternalAgentStartedState) LaunchError

func (s *ExternalAgentStartedState) LaunchError(err model.ErrorType) error

func (*ExternalAgentStartedState) Name

func (*ExternalAgentStartedState) Ready

func (s *ExternalAgentStartedState) Ready() error

func (*ExternalAgentStartedState) Register

func (s *ExternalAgentStartedState) Register(events []Event) error

func (*ExternalAgentStartedState) ShutdownFailed

func (s *ExternalAgentStartedState) ShutdownFailed() error

type ExternalAgentState

type ExternalAgentState interface {
	Register([]Event) error
	Ready() error
	InitError(errorType model.ErrorType) error
	ExitError(errorType model.ErrorType) error
	ShutdownFailed() error
	Exited() error
	LaunchError(model.ErrorType) error
	Name() string
}

type Gate

type Gate interface {
	Register(count uint16)
	Reset()
	SetCount(uint16) error
	WalkThrough(interface{}) error
	AwaitGateCondition(ctx context.Context) (interface{}, error)
	CancelWithError(error)
	Clear()
}

func NewGate

func NewGate(count uint16) Gate

type InitFlowSynchronization

type InitFlowSynchronization interface {
	SetExternalAgentsRegisterCount(uint16) error
	SetAgentsReadyCount(uint16) error

	ExternalAgentRegistered() error
	AwaitExternalAgentsRegistered(context.Context) error

	RuntimeReady() error
	AwaitRuntimeReady(context.Context) error

	AgentReady() error
	AwaitAgentsReady(context.Context) error

	CancelWithError(error)

	Clear()
}

func NewInitFlowSynchronization

func NewInitFlowSynchronization() InitFlowSynchronization

type InternalAgent

type InternalAgent struct {
	ManagedThread Suspendable

	StartedState    InternalAgentState
	RegisteredState InternalAgentState
	RunningState    InternalAgentState
	ReadyState      InternalAgentState
	InitErrorState  InternalAgentState
	ExitErrorState  InternalAgentState
	// contains filtered or unexported fields
}

func NewInternalAgent

func NewInternalAgent(name string, initFlow InitFlowSynchronization) *InternalAgent

func (*InternalAgent) ErrorType

func (s *InternalAgent) ErrorType() model.ErrorType

func (*InternalAgent) ExitError

func (s *InternalAgent) ExitError(errorType model.ErrorType) error

func (*InternalAgent) GetAgentDescription

func (s *InternalAgent) GetAgentDescription() statejson.ExtensionDescription

func (*InternalAgent) GetState

func (s *InternalAgent) GetState() InternalAgentState

func (*InternalAgent) ID

func (s *InternalAgent) ID() uuid.UUID

func (*InternalAgent) InitError

func (s *InternalAgent) InitError(errorType model.ErrorType) error

func (*InternalAgent) Name

func (s *InternalAgent) Name() string

func (*InternalAgent) Ready

func (s *InternalAgent) Ready() error

func (*InternalAgent) Register

func (s *InternalAgent) Register(events []Event) error

func (*InternalAgent) Release

func (s *InternalAgent) Release()

func (*InternalAgent) SetState

func (s *InternalAgent) SetState(state InternalAgentState)

func (InternalAgent) String

func (s InternalAgent) String() string

func (*InternalAgent) SuspendUnsafe

func (s *InternalAgent) SuspendUnsafe()

type InternalAgentExitErrorState

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

func (*InternalAgentExitErrorState) ExitError

func (s *InternalAgentExitErrorState) ExitError(errorType model.ErrorType) error

func (*InternalAgentExitErrorState) Exited

func (s *InternalAgentExitErrorState) Exited() error

func (*InternalAgentExitErrorState) InitError

func (s *InternalAgentExitErrorState) InitError(errorType model.ErrorType) error

func (*InternalAgentExitErrorState) LaunchError

func (s *InternalAgentExitErrorState) LaunchError(model.ErrorType) error

func (*InternalAgentExitErrorState) Name

func (*InternalAgentExitErrorState) Ready

func (s *InternalAgentExitErrorState) Ready() error

func (*InternalAgentExitErrorState) Register

func (s *InternalAgentExitErrorState) Register(events []Event) error

func (*InternalAgentExitErrorState) ShutdownFailed

func (s *InternalAgentExitErrorState) ShutdownFailed() error

type InternalAgentInitErrorState

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

func (*InternalAgentInitErrorState) ExitError

func (s *InternalAgentInitErrorState) ExitError(errorType model.ErrorType) error

func (*InternalAgentInitErrorState) Exited

func (s *InternalAgentInitErrorState) Exited() error

func (*InternalAgentInitErrorState) InitError

func (s *InternalAgentInitErrorState) InitError(errorType model.ErrorType) error

func (*InternalAgentInitErrorState) LaunchError

func (s *InternalAgentInitErrorState) LaunchError(model.ErrorType) error

func (*InternalAgentInitErrorState) Name

func (*InternalAgentInitErrorState) Ready

func (s *InternalAgentInitErrorState) Ready() error

func (*InternalAgentInitErrorState) Register

func (s *InternalAgentInitErrorState) Register(events []Event) error

func (*InternalAgentInitErrorState) ShutdownFailed

func (s *InternalAgentInitErrorState) ShutdownFailed() error

type InternalAgentReadyState

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

func (*InternalAgentReadyState) ExitError

func (s *InternalAgentReadyState) ExitError(errorType model.ErrorType) error

func (*InternalAgentReadyState) Exited

func (s *InternalAgentReadyState) Exited() error

func (*InternalAgentReadyState) InitError

func (s *InternalAgentReadyState) InitError(errorType model.ErrorType) error

func (*InternalAgentReadyState) LaunchError

func (s *InternalAgentReadyState) LaunchError(model.ErrorType) error

func (*InternalAgentReadyState) Name

func (s *InternalAgentReadyState) Name() string

func (*InternalAgentReadyState) Ready

func (s *InternalAgentReadyState) Ready() error

func (*InternalAgentReadyState) Register

func (s *InternalAgentReadyState) Register(events []Event) error

func (*InternalAgentReadyState) ShutdownFailed

func (s *InternalAgentReadyState) ShutdownFailed() error

type InternalAgentRegisteredState

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

func (*InternalAgentRegisteredState) ExitError

func (s *InternalAgentRegisteredState) ExitError(errorType model.ErrorType) error

func (*InternalAgentRegisteredState) Exited

func (s *InternalAgentRegisteredState) Exited() error

func (*InternalAgentRegisteredState) InitError

func (s *InternalAgentRegisteredState) InitError(errorType model.ErrorType) error

func (*InternalAgentRegisteredState) LaunchError

func (s *InternalAgentRegisteredState) LaunchError(model.ErrorType) error

func (*InternalAgentRegisteredState) Name

func (*InternalAgentRegisteredState) Ready

func (*InternalAgentRegisteredState) Register

func (s *InternalAgentRegisteredState) Register(events []Event) error

func (*InternalAgentRegisteredState) ShutdownFailed

func (s *InternalAgentRegisteredState) ShutdownFailed() error

type InternalAgentRunningState

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

func (*InternalAgentRunningState) ExitError

func (s *InternalAgentRunningState) ExitError(errorType model.ErrorType) error

func (*InternalAgentRunningState) Exited

func (s *InternalAgentRunningState) Exited() error

func (*InternalAgentRunningState) InitError

func (s *InternalAgentRunningState) InitError(errorType model.ErrorType) error

func (*InternalAgentRunningState) LaunchError

func (s *InternalAgentRunningState) LaunchError(model.ErrorType) error

func (*InternalAgentRunningState) Name

func (*InternalAgentRunningState) Ready

func (s *InternalAgentRunningState) Ready() error

func (*InternalAgentRunningState) Register

func (s *InternalAgentRunningState) Register(events []Event) error

func (*InternalAgentRunningState) ShutdownFailed

func (s *InternalAgentRunningState) ShutdownFailed() error

type InternalAgentStartedState

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

func (*InternalAgentStartedState) ExitError

func (s *InternalAgentStartedState) ExitError(errorType model.ErrorType) error

func (*InternalAgentStartedState) Exited

func (s *InternalAgentStartedState) Exited() error

func (*InternalAgentStartedState) InitError

func (s *InternalAgentStartedState) InitError(errorType model.ErrorType) error

func (*InternalAgentStartedState) LaunchError

func (s *InternalAgentStartedState) LaunchError(model.ErrorType) error

func (*InternalAgentStartedState) Name

func (*InternalAgentStartedState) Ready

func (s *InternalAgentStartedState) Ready() error

func (*InternalAgentStartedState) Register

func (s *InternalAgentStartedState) Register(events []Event) error

func (*InternalAgentStartedState) ShutdownFailed

func (s *InternalAgentStartedState) ShutdownFailed() error

type InternalAgentState

type InternalAgentState interface {
	Register([]Event) error
	Ready() error
	InitError(errorType model.ErrorType) error
	ExitError(errorType model.ErrorType) error
	Name() string
}

type ManagedThread

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

func NewManagedThread

func NewManagedThread() *ManagedThread

func (*ManagedThread) Lock

func (s *ManagedThread) Lock()

func (*ManagedThread) Release

func (s *ManagedThread) Release()

func (*ManagedThread) SuspendUnsafe

func (s *ManagedThread) SuspendUnsafe()

func (*ManagedThread) Unlock

func (s *ManagedThread) Unlock()

type RegistrationService

type RegistrationService interface {
	CreateExternalAgent(agentName string) (*ExternalAgent, error)
	CreateInternalAgent(agentName string) (*InternalAgent, error)
	PreregisterRuntime(r *Runtime) error
	SetFunctionMetadata(metadata model.FunctionMetadata)
	GetFunctionMetadata() model.FunctionMetadata
	GetRuntime() *Runtime
	GetRegisteredAgentsSize() uint16
	FindExternalAgentByName(agentName string) (*ExternalAgent, bool)
	FindInternalAgentByName(agentName string) (*InternalAgent, bool)
	FindExternalAgentByID(agentID uuid.UUID) (*ExternalAgent, bool)
	FindInternalAgentByID(agentID uuid.UUID) (*InternalAgent, bool)
	TurnOff()
	InitFlow() InitFlowSynchronization
	GetInternalStateDescriptor(appCtx appctx.ApplicationContext) func() statejson.InternalStateDescription
	GetInternalAgents() []*InternalAgent
	GetExternalAgents() []*ExternalAgent
	GetSubscribedExternalAgents(eventType Event) []*ExternalAgent
	CountAgents() int
	Clear()
	AgentsInfo() []AgentInfo
	CancelFlows(err error)
}

func NewRegistrationService

func NewRegistrationService(initFlow InitFlowSynchronization) RegistrationService

type Runtime

type Runtime struct {
	ManagedThread Suspendable

	RuntimeStartedState   RuntimeState
	RuntimeInitErrorState RuntimeState
	RuntimeReadyState     RuntimeState
	RuntimeRunningState   RuntimeState
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime(initFlow InitFlowSynchronization) *Runtime

func (*Runtime) GetRuntimeDescription

func (s *Runtime) GetRuntimeDescription() statejson.RuntimeDescription

func (*Runtime) GetState

func (s *Runtime) GetState() RuntimeState

func (*Runtime) InitError

func (s *Runtime) InitError() error

func (*Runtime) Ready

func (s *Runtime) Ready() error

func (*Runtime) Release

func (s *Runtime) Release()

func (*Runtime) SetState

func (s *Runtime) SetState(state RuntimeState)

type RuntimeInitErrorState

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

func (*RuntimeInitErrorState) InitError

func (s *RuntimeInitErrorState) InitError() error

func (*RuntimeInitErrorState) Name

func (s *RuntimeInitErrorState) Name() string

func (*RuntimeInitErrorState) Ready

func (s *RuntimeInitErrorState) Ready() error

type RuntimeReadyState

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

func (*RuntimeReadyState) InitError

func (s *RuntimeReadyState) InitError() error

func (*RuntimeReadyState) Name

func (s *RuntimeReadyState) Name() string

func (*RuntimeReadyState) Ready

func (s *RuntimeReadyState) Ready() error

type RuntimeRunningState

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

func (*RuntimeRunningState) InitError

func (s *RuntimeRunningState) InitError() error

func (*RuntimeRunningState) Name

func (s *RuntimeRunningState) Name() string

func (*RuntimeRunningState) Ready

func (s *RuntimeRunningState) Ready() error

type RuntimeStartedState

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

func (*RuntimeStartedState) InitError

func (s *RuntimeStartedState) InitError() error

func (*RuntimeStartedState) Name

func (s *RuntimeStartedState) Name() string

func (*RuntimeStartedState) Ready

func (s *RuntimeStartedState) Ready() error

type RuntimeState

type RuntimeState interface {
	InitError() error
	Ready() error
	Name() string
}

type Suspendable

type Suspendable interface {
	SuspendUnsafe()
	Release()
	Lock()
	Unlock()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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