core

package
v0.0.0-...-6be47e1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package core provides state objects and synchronization primitives for managing data flow in the system.

States

Runtime and Agent implement state object design pattern.

Runtime state interface:

type RuntimeState interface {
	InitError() error
	Ready() error
	InvocationResponse() error
	InvocationErrorResponse() error
}

Gates

Gates provide synchornization primitives for managing data flow in the system.

Gate is a synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes.

To better understand gates, consider two examples below:

Example 1: main thread is awaiting registered threads to walk through the gate,

and after the last registered thread walked through the gate, gate
condition will be satisfied and main thread will proceed:

[main] // register threads with the gate and start threads ... [main] g.AwaitGateCondition() [main] // blocked until gate condition is satisfied

[thread] g.WalkThrough() [thread] // not blocked

Example 2: main thread is awaiting registered threads to arrive at the gate,

and after the last registered thread arrives at the gate, gate
condition will be satisfied and main thread, along with registered
threads will proceed:

[main] // register threads with the gate and start threads ... [main] g.AwaitGateCondition() [main] // blocked until gate condition is satisfied

Flow

Flow wraps a set of specific gates required to implement specific data flow in the system.

Example flows would be INIT, INVOKE and RESET.

Registrations

Registration service manages registrations, it maintains the mapping between registered parties are events they are registered. Parties not registered in the system will not be issued events.

Index

Constants

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

String values of possibles agent states

View Source
const (
	UNBLOCKED = iota
	BLOCKED
)
View Source
const (
	RuntimeStartedStateName   = "Started"
	RuntimeInitErrorStateName = "InitError"
	RuntimeReadyStateName     = "Ready"
	RuntimeRunningStateName   = "Running"
	// RuntimeStartedState -> RuntimeRestoreReadyState
	RuntimeRestoreReadyStateName = "RestoreReady"
	// RuntimeRestoreReadyState -> RuntimeRestoringState
	RuntimeRestoringStateName               = "Restoring"
	RuntimeInvocationResponseStateName      = "InvocationResponse"
	RuntimeInvocationErrorResponseStateName = "InvocationErrorResponse"
	RuntimeResponseSentStateName            = "RuntimeResponseSentState"
	RuntimeRestoreErrorStateName            = "RuntimeRestoreErrorState"
)

String values of possibles runtime states

View Source
const MaxAgentsAllowed = 10

Variables

View Source
var ErrAgentIDCollision = errors.New("ErrAgentIDCollision")

ErrAgentIDCollision means that agent with the same ID already exists in AgentsMap

View Source
var ErrAgentNameCollision = errors.New("ErrAgentNameCollision")

ErrAgentNameCollision means that agent with the same name already exists in AgentsMap

View Source
var ErrConcurrentStateModification = errors.New("Concurrent state modification")

ErrConcurrentStateModification returned when we've detected an invalid state transision caused by concurrent modification

View Source
var ErrCredentialsNotFound = fmt.Errorf("credentials not found for the provided token")
View Source
var ErrGateCanceled = errors.New("ErrGateCanceled")

ErrGateCanceled ...

View Source
var ErrGateIntegrity = errors.New("ErrGateIntegrity")

ErrGateIntegrity ...

View Source
var ErrNotAllowed = errors.New("State transition is not allowed")

ErrNotAllowed returned on illegal state transition

View Source
var ErrRegistrationServiceOff = errors.New("ErrRegistrationServiceOff")

ErrRegistrationServiceOff returned on attempt to register after registration service has been turned off.

View Source
var ErrTooManyExtensions = errors.New("ErrTooManyExtensions")

ErrTooManyExtensions means MaxAgentsAllowed limit is exceeded

Functions

func ValidateExternalAgentEvent

func ValidateExternalAgentEvent(e Event) error

func ValidateInternalAgentEvent

func ValidateInternalAgentEvent(e Event) error

Types

type AgentInfo

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

AgentInfo holds information about an agent renderable in customer logs

type AgentInfoErrorType

type AgentInfoErrorType string
const (
	PermissionDenied  AgentInfoErrorType = "PermissionDenied"
	TooManyExtensions AgentInfoErrorType = "TooManyExtensions"
	UnknownError      AgentInfoErrorType = "UnknownError"
)

func MapErrorToAgentInfoErrorType

func MapErrorToAgentInfoErrorType(err error) AgentInfoErrorType

type Credentials

type Credentials struct {
	AwsKey     string    `json:"AccessKeyId"`
	AwsSecret  string    `json:"SecretAccessKey"`
	AwsSession string    `json:"Token"`
	Expiration time.Time `json:"Expiration"`
}

type CredentialsService

type CredentialsService interface {
	SetCredentials(token, awsKey, awsSecret, awsSession string, expiration time.Time)
	GetCredentials(token string) (*Credentials, error)
	UpdateCredentials(awsKey, awsSecret, awsSession string, expiration time.Time) error
}

func NewCredentialsService

func NewCredentialsService() CredentialsService

type Event

type Event string

Event represents a platform event which agent can subscribe to

const (
	// InvokeEvent is dispatched when INVOKE happens
	InvokeEvent Event = "INVOKE"
	// ShutdownEvent is dispatched when SHUTDOWN or RESET happen
	ShutdownEvent Event = "SHUTDOWN"
)

type ExternalAgent

type ExternalAgent struct {
	Name string
	ID   uuid.UUID

	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
}

ExternalAgent represents external agent

func NewExternalAgent

func NewExternalAgent(name string, initFlow InitFlowSynchronization, invokeFlow InvokeFlowSynchronization) *ExternalAgent

NewExternalAgent returns new instance of a named agent

func (*ExternalAgent) ErrorType

func (s *ExternalAgent) ErrorType() string

ErrorType returns error type reported during init or exit

func (*ExternalAgent) ExitError

func (s *ExternalAgent) ExitError(errorType string) error

ExitError - agent reported unrecoverable error

func (*ExternalAgent) Exited

func (s *ExternalAgent) Exited() error

Exited - agent shut down successfully

func (*ExternalAgent) GetAgentDescription

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

GetAgentDescription returns agent description object for debugging purposes

func (*ExternalAgent) GetState

func (s *ExternalAgent) GetState() ExternalAgentState

GetState returns agent's current state

func (*ExternalAgent) InitError

func (s *ExternalAgent) InitError(errorType string) error

InitError - agent registered but failed to initialize

func (*ExternalAgent) IsSubscribed

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

IsSubscribed checks whether agent is subscribed the Event

func (*ExternalAgent) LaunchError

func (s *ExternalAgent) LaunchError(err error) error

Exited - agent shut down successfully

func (*ExternalAgent) Ready

func (s *ExternalAgent) Ready() error

Ready - mark an agent as ready

func (*ExternalAgent) Register

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

Register an agent with the platform

func (*ExternalAgent) Release

func (s *ExternalAgent) Release()

Release will resume a suspended thread

func (*ExternalAgent) SetState

func (s *ExternalAgent) SetState(state ExternalAgentState)

SetState using the lock

func (*ExternalAgent) ShutdownFailed

func (s *ExternalAgent) ShutdownFailed() error

ShutdownFailed - terminal state, agent didn't exit gracefully

func (*ExternalAgent) String

func (s *ExternalAgent) String() string

func (*ExternalAgent) SubscribedEvents

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

SubscribedEvents returns events to which the agent is subscribed

func (*ExternalAgent) SuspendUnsafe

func (s *ExternalAgent) SuspendUnsafe()

SuspendUnsafe the current running thread

type ExternalAgentExitErrorState

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

ExternalAgentExitErrorState is a terminal state where agent has reported /exit/error

func (*ExternalAgentExitErrorState) ExitError

func (s *ExternalAgentExitErrorState) ExitError(errorType string) error

ExitError - multiple calls are allowed, but only the first submitted error is accepted

func (*ExternalAgentExitErrorState) Exited

func (s *ExternalAgentExitErrorState) Exited() error

Exited

func (*ExternalAgentExitErrorState) InitError

func (s *ExternalAgentExitErrorState) InitError(errorType string) error

InitError

func (*ExternalAgentExitErrorState) LaunchError

func (s *ExternalAgentExitErrorState) LaunchError(error) error

LaunchError

func (*ExternalAgentExitErrorState) Name

Name return state's human friendly name

func (*ExternalAgentExitErrorState) Ready

func (s *ExternalAgentExitErrorState) Ready() error

Ready

func (*ExternalAgentExitErrorState) Register

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

Register

func (*ExternalAgentExitErrorState) ShutdownFailed

func (s *ExternalAgentExitErrorState) ShutdownFailed() error

ShutdownFailed

type ExternalAgentExitedState

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

func (*ExternalAgentExitedState) ExitError

func (s *ExternalAgentExitedState) ExitError(errorType string) error

ExitError

func (*ExternalAgentExitedState) Exited

func (s *ExternalAgentExitedState) Exited() error

Exited

func (*ExternalAgentExitedState) InitError

func (s *ExternalAgentExitedState) InitError(errorType string) error

InitError

func (*ExternalAgentExitedState) LaunchError

func (s *ExternalAgentExitedState) LaunchError(error) error

LaunchError

func (*ExternalAgentExitedState) Name

func (s *ExternalAgentExitedState) Name() string

Name return state's human friendly name

func (*ExternalAgentExitedState) Ready

func (s *ExternalAgentExitedState) Ready() error

Ready

func (*ExternalAgentExitedState) Register

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

Register

func (*ExternalAgentExitedState) ShutdownFailed

func (s *ExternalAgentExitedState) ShutdownFailed() error

ShutdownFailed

type ExternalAgentInitErrorState

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

ExternalAgentInitErrorState is a terminal state where agent has reported /init/error

func (*ExternalAgentInitErrorState) ExitError

func (s *ExternalAgentInitErrorState) ExitError(errorType string) error

ExitError

func (*ExternalAgentInitErrorState) Exited

func (s *ExternalAgentInitErrorState) Exited() error

Exited

func (*ExternalAgentInitErrorState) InitError

func (s *ExternalAgentInitErrorState) InitError(errorType string) error

InitError - multiple calls are allowed, but only the first submitted error is accepted

func (*ExternalAgentInitErrorState) LaunchError

func (s *ExternalAgentInitErrorState) LaunchError(error) error

LaunchError

func (*ExternalAgentInitErrorState) Name

Name return state's human friendly name

func (*ExternalAgentInitErrorState) Ready

func (s *ExternalAgentInitErrorState) Ready() error

Ready

func (*ExternalAgentInitErrorState) Register

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

Register

func (*ExternalAgentInitErrorState) ShutdownFailed

func (s *ExternalAgentInitErrorState) ShutdownFailed() error

ShutdownFailed

type ExternalAgentLaunchErrorState

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

func (*ExternalAgentLaunchErrorState) ExitError

func (s *ExternalAgentLaunchErrorState) ExitError(errorType string) error

ExitError

func (*ExternalAgentLaunchErrorState) Exited

func (s *ExternalAgentLaunchErrorState) Exited() error

Exited

func (*ExternalAgentLaunchErrorState) InitError

func (s *ExternalAgentLaunchErrorState) InitError(errorType string) error

InitError

func (*ExternalAgentLaunchErrorState) LaunchError

func (s *ExternalAgentLaunchErrorState) LaunchError(error) error

LaunchError

func (*ExternalAgentLaunchErrorState) Name

Name return state's human friendly name

func (*ExternalAgentLaunchErrorState) Ready

func (s *ExternalAgentLaunchErrorState) Ready() error

Ready

func (*ExternalAgentLaunchErrorState) Register

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

Register

func (*ExternalAgentLaunchErrorState) ShutdownFailed

func (s *ExternalAgentLaunchErrorState) ShutdownFailed() error

ShutdownFailed

type ExternalAgentReadyState

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

ExternalAgentReadyState is the state of an agent that reported ready to the platform

func (*ExternalAgentReadyState) ExitError

func (s *ExternalAgentReadyState) ExitError(errorType string) error

ExitError signals that agent provided unrecoverable error description

func (*ExternalAgentReadyState) Exited

func (s *ExternalAgentReadyState) Exited() error

Exited

func (*ExternalAgentReadyState) InitError

func (s *ExternalAgentReadyState) InitError(errorType string) error

InitError

func (*ExternalAgentReadyState) LaunchError

func (s *ExternalAgentReadyState) LaunchError(error) error

LaunchError

func (*ExternalAgentReadyState) Name

func (s *ExternalAgentReadyState) Name() string

Name return state's human friendly name

func (*ExternalAgentReadyState) Ready

func (s *ExternalAgentReadyState) Ready() error

Ready

func (*ExternalAgentReadyState) Register

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

Register

func (*ExternalAgentReadyState) ShutdownFailed

func (s *ExternalAgentReadyState) ShutdownFailed() error

ShutdownFailed

type ExternalAgentRegisteredState

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

ExternalAgentRegisteredState is the state of an agent that registered with the platform but has not reported ready (next)

func (*ExternalAgentRegisteredState) ExitError

func (s *ExternalAgentRegisteredState) ExitError(errorType string) error

ExitError - agent called /exit/error

func (*ExternalAgentRegisteredState) Exited

func (s *ExternalAgentRegisteredState) Exited() error

Exited

func (*ExternalAgentRegisteredState) InitError

func (s *ExternalAgentRegisteredState) InitError(errorType string) error

InitError - agent can transitions to InitErrorState if it failed to initialize

func (*ExternalAgentRegisteredState) LaunchError

func (s *ExternalAgentRegisteredState) LaunchError(error) error

LaunchError

func (*ExternalAgentRegisteredState) Name

Name return state's human friendly name

func (*ExternalAgentRegisteredState) Ready

Ready - agent has called next and is now successfully initialized

func (*ExternalAgentRegisteredState) Register

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

Register

func (*ExternalAgentRegisteredState) ShutdownFailed

func (s *ExternalAgentRegisteredState) ShutdownFailed() error

ShutdownFailed

type ExternalAgentRunningState

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

ExternalAgentRunningState is the state of an agent that has received an invoke event and is currently processing it

func (*ExternalAgentRunningState) ExitError

func (s *ExternalAgentRunningState) ExitError(errorType string) error

ExitError signals that agent provided unrecoverable error description

func (*ExternalAgentRunningState) Exited

func (s *ExternalAgentRunningState) Exited() error

Exited - agent process has exited

func (*ExternalAgentRunningState) InitError

func (s *ExternalAgentRunningState) InitError(errorType string) error

InitError

func (*ExternalAgentRunningState) LaunchError

func (s *ExternalAgentRunningState) LaunchError(error) error

LaunchError

func (*ExternalAgentRunningState) Name

Name return state's human friendly name

func (*ExternalAgentRunningState) Ready

func (s *ExternalAgentRunningState) Ready() error

Ready - agent transitions to Ready and the calling thread gets suspended. Upon release the agent transitions to Running

func (*ExternalAgentRunningState) Register

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

Register

func (*ExternalAgentRunningState) ShutdownFailed

func (s *ExternalAgentRunningState) ShutdownFailed() error

ShutdownFailed transitions agent into the ShutdownFailed terminal state

type ExternalAgentShutdownFailedState

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

func (*ExternalAgentShutdownFailedState) ExitError

func (s *ExternalAgentShutdownFailedState) ExitError(errorType string) error

ExitError

func (*ExternalAgentShutdownFailedState) Exited

func (s *ExternalAgentShutdownFailedState) Exited() error

Exited

func (*ExternalAgentShutdownFailedState) InitError

func (s *ExternalAgentShutdownFailedState) InitError(errorType string) error

InitError

func (*ExternalAgentShutdownFailedState) LaunchError

func (s *ExternalAgentShutdownFailedState) LaunchError(error) error

LaunchError

func (*ExternalAgentShutdownFailedState) Name

Name return state's human friendly name

func (*ExternalAgentShutdownFailedState) Ready

func (s *ExternalAgentShutdownFailedState) Ready() error

Ready

func (*ExternalAgentShutdownFailedState) Register

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

Register

func (*ExternalAgentShutdownFailedState) ShutdownFailed

func (s *ExternalAgentShutdownFailedState) ShutdownFailed() error

ShutdownFailed

type ExternalAgentStartedState

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

ExternalAgentStartedState is the initial state of an external agent

func (*ExternalAgentStartedState) ExitError

func (s *ExternalAgentStartedState) ExitError(errorType string) error

ExitError

func (*ExternalAgentStartedState) Exited

func (s *ExternalAgentStartedState) Exited() error

Exited

func (*ExternalAgentStartedState) InitError

func (s *ExternalAgentStartedState) InitError(errorType string) error

InitError

func (*ExternalAgentStartedState) LaunchError

func (s *ExternalAgentStartedState) LaunchError(err error) error

LaunchError signals that agent could not launch (non-exec/permission denied)

func (*ExternalAgentStartedState) Name

Name return state's human friendly name

func (*ExternalAgentStartedState) Ready

func (s *ExternalAgentStartedState) Ready() error

Ready

func (*ExternalAgentStartedState) Register

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

Register an agent with the platform when agent is in started state

func (*ExternalAgentStartedState) ShutdownFailed

func (s *ExternalAgentStartedState) ShutdownFailed() error

ShutdownFailed

type ExternalAgentState

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

ExternalAgentState is external agent state interface

type ExternalAgentsMap

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

ExternalAgentsMap stores Agents indexed by Name and ID

func NewExternalAgentsMap

func NewExternalAgentsMap() ExternalAgentsMap

NewExternalAgentsMap creates empty ExternalAgentsMap

func (*ExternalAgentsMap) AsArray

func (m *ExternalAgentsMap) AsArray() []*ExternalAgent

AsArray returns shallow copy of all agents as a single array. The order of agents is unspecified.

func (*ExternalAgentsMap) Clear

func (m *ExternalAgentsMap) Clear()

func (*ExternalAgentsMap) FindByID

func (m *ExternalAgentsMap) FindByID(id uuid.UUID) (agent *ExternalAgent, found bool)

FindByID finds agent by ID

func (*ExternalAgentsMap) FindByName

func (m *ExternalAgentsMap) FindByName(name string) (agent *ExternalAgent, found bool)

FindByName finds agent by name

func (*ExternalAgentsMap) Insert

func (m *ExternalAgentsMap) Insert(a *ExternalAgent) error

Insert places agent into ExternalAgentsMap. Error is returned if agent with this ID or name already exists

func (*ExternalAgentsMap) Size

func (m *ExternalAgentsMap) Size() int

Size returns the number of agents contained in the datastructure

func (*ExternalAgentsMap) Visit

func (m *ExternalAgentsMap) Visit(cb func(*ExternalAgent))

Visit iterates through agents, calling cb for each of them

type FunctionMetadata

type FunctionMetadata struct {
	AccountID         string
	FunctionName      string
	FunctionVersion   string
	InstanceMaxMemory uint64
	Handler           string
	RuntimeInfo       interop.RuntimeInfo
}

FunctionMetadata holds static information regarding the function (Name, Version, Handler)

type Gate

type Gate interface {
	Register(count uint16)
	Reset()
	SetCount(uint16) error
	WalkThrough() error
	AwaitGateCondition() error
	CancelWithError(error)
	Clear()
}

Gate ...

func NewGate

func NewGate(count uint16) Gate

NewGate returns new gate instance.

type InitFlowSynchronization

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

	ExternalAgentRegistered() error
	AwaitExternalAgentsRegistered() error

	RuntimeReady() error
	AwaitRuntimeReady() error
	AwaitRuntimeReadyWithDeadline(context.Context) error

	AgentReady() error
	AwaitAgentsReady() error

	CancelWithError(error)

	RuntimeRestoreReady() error
	AwaitRuntimeRestoreReady() error

	Clear()
}

InitFlowSynchronization wraps init flow barriers.

func NewInitFlowSynchronization

func NewInitFlowSynchronization() InitFlowSynchronization

NewInitFlowSynchronization returns new InitFlowSynchronization instance.

type InternalAgent

type InternalAgent struct {
	Name string
	ID   uuid.UUID

	ManagedThread Suspendable

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

InternalAgent represents internal agent

func NewInternalAgent

func NewInternalAgent(name string, initFlow InitFlowSynchronization, invokeFlow InvokeFlowSynchronization) *InternalAgent

NewInternalAgent returns new instance of a named agent

func (*InternalAgent) ErrorType

func (s *InternalAgent) ErrorType() string

ErrorType returns error type reported during init or exit

func (*InternalAgent) ExitError

func (s *InternalAgent) ExitError(errorType string) error

ExitError - agent registered but failed to initialize

func (*InternalAgent) GetAgentDescription

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

GetAgentDescription returns agent description object for debugging purposes

func (*InternalAgent) GetState

func (s *InternalAgent) GetState() InternalAgentState

GetState returns agent's current state

func (*InternalAgent) InitError

func (s *InternalAgent) InitError(errorType string) error

InitError - agent registered but failed to initialize

func (*InternalAgent) IsSubscribed

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

IsSubscribed checks whether agent is subscribed the Event

func (*InternalAgent) Ready

func (s *InternalAgent) Ready() error

Ready - mark an agent as ready

func (*InternalAgent) Register

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

Register an agent with the platform

func (*InternalAgent) Release

func (s *InternalAgent) Release()

Release will resume a suspended thread

func (*InternalAgent) SetState

func (s *InternalAgent) SetState(state InternalAgentState)

SetState using the lock

func (*InternalAgent) String

func (s *InternalAgent) String() string

func (*InternalAgent) SubscribedEvents

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

SubscribedEvents returns events to which the agent is subscribed

func (*InternalAgent) SuspendUnsafe

func (s *InternalAgent) SuspendUnsafe()

SuspendUnsafe the current running thread

type InternalAgentExitErrorState

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

InternalAgentExitErrorState is a terminal state where agent has reported /exit/error

func (*InternalAgentExitErrorState) ExitError

func (s *InternalAgentExitErrorState) ExitError(errorType string) error

ExitError - multiple calls are allowed, but only the first submitted error is accepted

func (*InternalAgentExitErrorState) Exited

func (s *InternalAgentExitErrorState) Exited() error

Exited

func (*InternalAgentExitErrorState) InitError

func (s *InternalAgentExitErrorState) InitError(errorType string) error

InitError

func (*InternalAgentExitErrorState) LaunchError

func (s *InternalAgentExitErrorState) LaunchError(error) error

LaunchError

func (*InternalAgentExitErrorState) Name

Name return state's human friendly name

func (*InternalAgentExitErrorState) Ready

func (s *InternalAgentExitErrorState) Ready() error

Ready

func (*InternalAgentExitErrorState) Register

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

Register

func (*InternalAgentExitErrorState) ShutdownFailed

func (s *InternalAgentExitErrorState) ShutdownFailed() error

ShutdownFailed

type InternalAgentInitErrorState

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

InternalAgentInitErrorState is a terminal state where agent has reported /init/error

func (*InternalAgentInitErrorState) ExitError

func (s *InternalAgentInitErrorState) ExitError(errorType string) error

ExitError

func (*InternalAgentInitErrorState) Exited

func (s *InternalAgentInitErrorState) Exited() error

Exited

func (*InternalAgentInitErrorState) InitError

func (s *InternalAgentInitErrorState) InitError(errorType string) error

InitError - multiple calls are allowed, but only the first submitted error is accepted

func (*InternalAgentInitErrorState) LaunchError

func (s *InternalAgentInitErrorState) LaunchError(error) error

LaunchError

func (*InternalAgentInitErrorState) Name

Name return state's human friendly name

func (*InternalAgentInitErrorState) Ready

func (s *InternalAgentInitErrorState) Ready() error

Ready

func (*InternalAgentInitErrorState) Register

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

Register

func (*InternalAgentInitErrorState) ShutdownFailed

func (s *InternalAgentInitErrorState) ShutdownFailed() error

ShutdownFailed

type InternalAgentReadyState

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

InternalAgentReadyState is the state of an agent that reported ready to the platform

func (*InternalAgentReadyState) ExitError

func (s *InternalAgentReadyState) ExitError(errorType string) error

ExitError - agent called /exit/error

func (*InternalAgentReadyState) Exited

func (s *InternalAgentReadyState) Exited() error

Exited

func (*InternalAgentReadyState) InitError

func (s *InternalAgentReadyState) InitError(errorType string) error

InitError

func (*InternalAgentReadyState) LaunchError

func (s *InternalAgentReadyState) LaunchError(error) error

LaunchError

func (*InternalAgentReadyState) Name

func (s *InternalAgentReadyState) Name() string

Name return state's human friendly name

func (*InternalAgentReadyState) Ready

func (s *InternalAgentReadyState) Ready() error

Ready

func (*InternalAgentReadyState) Register

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

Register

func (*InternalAgentReadyState) ShutdownFailed

func (s *InternalAgentReadyState) ShutdownFailed() error

ShutdownFailed

type InternalAgentRegisteredState

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

InternalAgentRegisteredState is the state of an agent that registered with the platform but has not reported ready (next)

func (*InternalAgentRegisteredState) ExitError

func (s *InternalAgentRegisteredState) ExitError(errorType string) error

ExitError - agent called /exit/error

func (*InternalAgentRegisteredState) Exited

func (s *InternalAgentRegisteredState) Exited() error

Exited

func (*InternalAgentRegisteredState) InitError

func (s *InternalAgentRegisteredState) InitError(errorType string) error

InitError - agent can transitions to InitErrorState if it failed to initialize

func (*InternalAgentRegisteredState) LaunchError

func (s *InternalAgentRegisteredState) LaunchError(error) error

LaunchError

func (*InternalAgentRegisteredState) Name

Name return state's human friendly name

func (*InternalAgentRegisteredState) Ready

Ready - agent has called next and is now successfully initialized

func (*InternalAgentRegisteredState) Register

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

Register

func (*InternalAgentRegisteredState) ShutdownFailed

func (s *InternalAgentRegisteredState) ShutdownFailed() error

ShutdownFailed

type InternalAgentRunningState

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

InternalAgentRunningState is the state of an agent that is currently processing an event

func (*InternalAgentRunningState) ExitError

func (s *InternalAgentRunningState) ExitError(errorType string) error

ExitError - agent called /exit/error

func (*InternalAgentRunningState) Exited

func (s *InternalAgentRunningState) Exited() error

Exited

func (*InternalAgentRunningState) InitError

func (s *InternalAgentRunningState) InitError(errorType string) error

InitError

func (*InternalAgentRunningState) LaunchError

func (s *InternalAgentRunningState) LaunchError(error) error

LaunchError

func (*InternalAgentRunningState) Name

Name return state's human friendly name

func (*InternalAgentRunningState) Ready

func (s *InternalAgentRunningState) Ready() error

Ready - agent can transition from ready to ready

func (*InternalAgentRunningState) Register

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

Register

func (*InternalAgentRunningState) ShutdownFailed

func (s *InternalAgentRunningState) ShutdownFailed() error

ShutdownFailed

type InternalAgentStartedState

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

InternalAgentStartedState is the initial state of an internal agent

func (*InternalAgentStartedState) ExitError

func (s *InternalAgentStartedState) ExitError(errorType string) error

ExitError

func (*InternalAgentStartedState) Exited

func (s *InternalAgentStartedState) Exited() error

Exited

func (*InternalAgentStartedState) InitError

func (s *InternalAgentStartedState) InitError(errorType string) error

InitError

func (*InternalAgentStartedState) LaunchError

func (s *InternalAgentStartedState) LaunchError(error) error

LaunchError

func (*InternalAgentStartedState) Name

Name return state's human friendly name

func (*InternalAgentStartedState) Ready

func (s *InternalAgentStartedState) Ready() error

Ready

func (*InternalAgentStartedState) Register

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

Register an agent with the platform when agent is in started state

func (*InternalAgentStartedState) ShutdownFailed

func (s *InternalAgentStartedState) ShutdownFailed() error

ShutdownFailed

type InternalAgentState

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

InternalAgentState is internal agent state interface

type InternalAgentsMap

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

InternalAgentsMap stores Agents indexed by Name and ID

func NewInternalAgentsMap

func NewInternalAgentsMap() InternalAgentsMap

NewInternalAgentsMap creates empty InternalAgentsMap

func (*InternalAgentsMap) AsArray

func (m *InternalAgentsMap) AsArray() []*InternalAgent

AsArray returns shallow copy of all agents as a single array. The order of agents is unspecified.

func (*InternalAgentsMap) Clear

func (m *InternalAgentsMap) Clear()

func (*InternalAgentsMap) FindByID

func (m *InternalAgentsMap) FindByID(id uuid.UUID) (agent *InternalAgent, found bool)

FindByID finds agent by ID

func (*InternalAgentsMap) FindByName

func (m *InternalAgentsMap) FindByName(name string) (agent *InternalAgent, found bool)

FindByName finds agent by name

func (*InternalAgentsMap) Insert

func (m *InternalAgentsMap) Insert(a *InternalAgent) error

Insert places agent into InternalAgentsMap. Error is returned if agent with this ID or name already exists

func (*InternalAgentsMap) Size

func (m *InternalAgentsMap) Size() int

Size returns the number of agents contained in the datastructure

func (*InternalAgentsMap) Visit

func (m *InternalAgentsMap) Visit(cb func(*InternalAgent))

Visit iterates through agents, calling cb for each of them

type InvokeFlowSynchronization

type InvokeFlowSynchronization interface {
	InitializeBarriers() error
	AwaitRuntimeResponse() error
	AwaitRuntimeReady() error
	RuntimeResponse(runtime *Runtime) error
	RuntimeReady(runtime *Runtime) error
	SetAgentsReadyCount(agentCount uint16) error
	AgentReady() error
	AwaitAgentsReady() error
	CancelWithError(error)
	Clear()
}

InvokeFlowSynchronization wraps invoke flow barriers.

func NewInvokeFlowSynchronization

func NewInvokeFlowSynchronization() InvokeFlowSynchronization

NewInvokeFlowSynchronization returns new InvokeFlowSynchronization instance.

type ManagedThread

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

ManagedThread is suspendable on operator condition.

func NewManagedThread

func NewManagedThread() *ManagedThread

NewManagedThread returns new ManagedThread instance.

func (*ManagedThread) Lock

func (s *ManagedThread) Lock()

Lock ManagedThread condvar mutex

func (*ManagedThread) Release

func (s *ManagedThread) Release()

Release releases operator condition. This allows thread to be suspended and then resumed from the main thread.

func (*ManagedThread) SuspendUnsafe

func (s *ManagedThread) SuspendUnsafe()

SuspendUnsafe suspends ManagedThread on operator condition. This allows thread to be suspended and then resumed from the main thread. It's marked Unsafe because ManagedThread should be locked before SuspendUnsafe is called

func (*ManagedThread) Unlock

func (s *ManagedThread) Unlock()

Unlock ManagedThread condvar mutex

type RegistrationService

type RegistrationService interface {
	CreateExternalAgent(agentName string) (*ExternalAgent, error)
	CreateInternalAgent(agentName string) (*InternalAgent, error)
	PreregisterRuntime(r *Runtime) error
	SetFunctionMetadata(metadata FunctionMetadata)
	GetFunctionMetadata() 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
	GetExternalAgents() []*ExternalAgent
	GetSubscribedExternalAgents(eventType Event) []*ExternalAgent
	GetSubscribedInternalAgents(eventType Event) []*InternalAgent
	CountAgents() int
	Clear()
	AgentsInfo() []AgentInfo
	CancelFlows(err error)
}

RegistrationService keeps track of registered parties, including external agents, threads, and runtime.

func NewRegistrationService

func NewRegistrationService(initFlow InitFlowSynchronization, invokeFlow InvokeFlowSynchronization) RegistrationService

NewRegistrationService returns new RegistrationService instance.

type Runtime

type Runtime struct {
	ManagedThread Suspendable

	RuntimeStartedState                 RuntimeState
	RuntimeInitErrorState               RuntimeState
	RuntimeReadyState                   RuntimeState
	RuntimeRunningState                 RuntimeState
	RuntimeRestoreReadyState            RuntimeState
	RuntimeRestoringState               RuntimeState
	RuntimeInvocationResponseState      RuntimeState
	RuntimeInvocationErrorResponseState RuntimeState
	RuntimeResponseSentState            RuntimeState
	RuntimeRestoreErrorState            RuntimeState
	// contains filtered or unexported fields
}

Runtime is runtime object.

func NewRuntime

func NewRuntime(initFlow InitFlowSynchronization, invokeFlow InvokeFlowSynchronization) *Runtime

NewRuntime returns new Runtime instance.

func (*Runtime) GetRuntimeDescription

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

GetRuntimeDescription returns runtime description object for debugging purposes

func (*Runtime) GetState

func (s *Runtime) GetState() RuntimeState

GetState ...

func (*Runtime) InitError

func (s *Runtime) InitError() error

InitError delegates to state implementation.

func (*Runtime) InvocationErrorResponse

func (s *Runtime) InvocationErrorResponse() error

InvocationErrorResponse delegates to state implementation.

func (*Runtime) InvocationResponse

func (s *Runtime) InvocationResponse() error

InvocationResponse delegates to state implementation.

func (*Runtime) Ready

func (s *Runtime) Ready() error

Ready delegates to state implementation.

func (*Runtime) Release

func (s *Runtime) Release()

Release ...

func (*Runtime) ResponseSent

func (s *Runtime) ResponseSent() error

ResponseSent delegates to state implementation.

func (*Runtime) RestoreError

func (s *Runtime) RestoreError(UserError interop.FunctionError) error

func (*Runtime) RestoreReady

func (s *Runtime) RestoreReady() error

func (*Runtime) SetState

func (s *Runtime) SetState(state RuntimeState)

SetState ...

type RuntimeInitErrorState

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

RuntimeInitErrorState runtime started state.

func (*RuntimeInitErrorState) InitError

func (s *RuntimeInitErrorState) InitError() error

func (*RuntimeInitErrorState) InvocationErrorResponse

func (s *RuntimeInitErrorState) InvocationErrorResponse() error

func (*RuntimeInitErrorState) InvocationResponse

func (s *RuntimeInitErrorState) InvocationResponse() error

func (*RuntimeInitErrorState) Name

func (s *RuntimeInitErrorState) Name() string

Name ...

func (*RuntimeInitErrorState) Ready

func (s *RuntimeInitErrorState) Ready() error

func (*RuntimeInitErrorState) ResponseSent

func (s *RuntimeInitErrorState) ResponseSent() error

func (*RuntimeInitErrorState) RestoreError

func (s *RuntimeInitErrorState) RestoreError(interop.FunctionError) error

func (*RuntimeInitErrorState) RestoreReady

func (s *RuntimeInitErrorState) RestoreReady() error

type RuntimeInvocationErrorResponseState

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

RuntimeInvocationErrorResponseState runtime response is available. Start state for runtime error response submission.

func (*RuntimeInvocationErrorResponseState) InitError

func (s *RuntimeInvocationErrorResponseState) InitError() error

func (*RuntimeInvocationErrorResponseState) InvocationErrorResponse

func (s *RuntimeInvocationErrorResponseState) InvocationErrorResponse() error

func (*RuntimeInvocationErrorResponseState) InvocationResponse

func (s *RuntimeInvocationErrorResponseState) InvocationResponse() error

func (*RuntimeInvocationErrorResponseState) Name

Name ...

func (*RuntimeInvocationErrorResponseState) Ready

func (s *RuntimeInvocationErrorResponseState) Ready() error

func (*RuntimeInvocationErrorResponseState) ResponseSent

func (s *RuntimeInvocationErrorResponseState) ResponseSent() error

ResponseSent completes RuntimeInvocationErrorResponseState.

func (*RuntimeInvocationErrorResponseState) RestoreError

func (s *RuntimeInvocationErrorResponseState) RestoreError(interop.FunctionError) error

func (*RuntimeInvocationErrorResponseState) RestoreReady

func (s *RuntimeInvocationErrorResponseState) RestoreReady() error

type RuntimeInvocationResponseState

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

RuntimeInvocationResponseState runtime response is available. Start state for runtime response submission.

func (*RuntimeInvocationResponseState) InitError

func (s *RuntimeInvocationResponseState) InitError() error

func (*RuntimeInvocationResponseState) InvocationErrorResponse

func (s *RuntimeInvocationResponseState) InvocationErrorResponse() error

func (*RuntimeInvocationResponseState) InvocationResponse

func (s *RuntimeInvocationResponseState) InvocationResponse() error

func (*RuntimeInvocationResponseState) Name

Name ...

func (*RuntimeInvocationResponseState) Ready

func (s *RuntimeInvocationResponseState) Ready() error

func (*RuntimeInvocationResponseState) ResponseSent

func (s *RuntimeInvocationResponseState) ResponseSent() error

ResponseSent completes RuntimeInvocationResponseState.

func (*RuntimeInvocationResponseState) RestoreError

func (s *RuntimeInvocationResponseState) RestoreError(interop.FunctionError) error

func (*RuntimeInvocationResponseState) RestoreReady

func (s *RuntimeInvocationResponseState) RestoreReady() error

type RuntimeReadyState

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

RuntimeReadyState runtime ready state.

func (*RuntimeReadyState) InitError

func (s *RuntimeReadyState) InitError() error

func (*RuntimeReadyState) InvocationErrorResponse

func (s *RuntimeReadyState) InvocationErrorResponse() error

func (*RuntimeReadyState) InvocationResponse

func (s *RuntimeReadyState) InvocationResponse() error

func (*RuntimeReadyState) Name

func (s *RuntimeReadyState) Name() string

Name ...

func (*RuntimeReadyState) Ready

func (s *RuntimeReadyState) Ready() error

func (*RuntimeReadyState) ResponseSent

func (s *RuntimeReadyState) ResponseSent() error

func (*RuntimeReadyState) RestoreError

func (s *RuntimeReadyState) RestoreError(interop.FunctionError) error

func (*RuntimeReadyState) RestoreReady

func (s *RuntimeReadyState) RestoreReady() error

type RuntimeResponseSentState

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

RuntimeResponseSentState ends started runtime response or runtime error response submission.

func (*RuntimeResponseSentState) InitError

func (s *RuntimeResponseSentState) InitError() error

func (*RuntimeResponseSentState) InvocationErrorResponse

func (s *RuntimeResponseSentState) InvocationErrorResponse() error

func (*RuntimeResponseSentState) InvocationResponse

func (s *RuntimeResponseSentState) InvocationResponse() error

func (*RuntimeResponseSentState) Name

func (s *RuntimeResponseSentState) Name() string

Name ...

func (*RuntimeResponseSentState) Ready

func (s *RuntimeResponseSentState) Ready() error

Ready call when runtime ready.

func (*RuntimeResponseSentState) ResponseSent

func (s *RuntimeResponseSentState) ResponseSent() error

func (*RuntimeResponseSentState) RestoreError

func (s *RuntimeResponseSentState) RestoreError(interop.FunctionError) error

func (*RuntimeResponseSentState) RestoreReady

func (s *RuntimeResponseSentState) RestoreReady() error

type RuntimeRestoreErrorState

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

func (*RuntimeRestoreErrorState) InitError

func (s *RuntimeRestoreErrorState) InitError() error

func (*RuntimeRestoreErrorState) InvocationErrorResponse

func (s *RuntimeRestoreErrorState) InvocationErrorResponse() error

func (*RuntimeRestoreErrorState) InvocationResponse

func (s *RuntimeRestoreErrorState) InvocationResponse() error

func (*RuntimeRestoreErrorState) Name

func (s *RuntimeRestoreErrorState) Name() string

func (*RuntimeRestoreErrorState) Ready

func (s *RuntimeRestoreErrorState) Ready() error

func (*RuntimeRestoreErrorState) ResponseSent

func (s *RuntimeRestoreErrorState) ResponseSent() error

func (*RuntimeRestoreErrorState) RestoreError

func (s *RuntimeRestoreErrorState) RestoreError(interop.FunctionError) error

func (*RuntimeRestoreErrorState) RestoreReady

func (s *RuntimeRestoreErrorState) RestoreReady() error

type RuntimeRestoreReadyState

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

func (*RuntimeRestoreReadyState) InitError

func (s *RuntimeRestoreReadyState) InitError() error

func (*RuntimeRestoreReadyState) InvocationErrorResponse

func (s *RuntimeRestoreReadyState) InvocationErrorResponse() error

func (*RuntimeRestoreReadyState) InvocationResponse

func (s *RuntimeRestoreReadyState) InvocationResponse() error

func (*RuntimeRestoreReadyState) Name

func (s *RuntimeRestoreReadyState) Name() string

func (*RuntimeRestoreReadyState) Ready

func (s *RuntimeRestoreReadyState) Ready() error

func (*RuntimeRestoreReadyState) ResponseSent

func (s *RuntimeRestoreReadyState) ResponseSent() error

func (*RuntimeRestoreReadyState) RestoreError

func (s *RuntimeRestoreReadyState) RestoreError(interop.FunctionError) error

func (*RuntimeRestoreReadyState) RestoreReady

func (s *RuntimeRestoreReadyState) RestoreReady() error

type RuntimeRestoringState

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

func (*RuntimeRestoringState) InitError

func (s *RuntimeRestoringState) InitError() error

func (*RuntimeRestoringState) InvocationErrorResponse

func (s *RuntimeRestoringState) InvocationErrorResponse() error

func (*RuntimeRestoringState) InvocationResponse

func (s *RuntimeRestoringState) InvocationResponse() error

func (*RuntimeRestoringState) Name

func (s *RuntimeRestoringState) Name() string

func (*RuntimeRestoringState) Ready

func (s *RuntimeRestoringState) Ready() error

Runtime is healthy after restore and called /next

func (*RuntimeRestoringState) ResponseSent

func (s *RuntimeRestoringState) ResponseSent() error

func (*RuntimeRestoringState) RestoreError

func (s *RuntimeRestoringState) RestoreError(userError interop.FunctionError) error

func (*RuntimeRestoringState) RestoreReady

func (s *RuntimeRestoringState) RestoreReady() error

type RuntimeRunningState

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

RuntimeRunningState runtime ready state.

func (*RuntimeRunningState) InitError

func (s *RuntimeRunningState) InitError() error

func (*RuntimeRunningState) InvocationErrorResponse

func (s *RuntimeRunningState) InvocationErrorResponse() error

InvocationErrorResponse call when runtime error response is available.

func (*RuntimeRunningState) InvocationResponse

func (s *RuntimeRunningState) InvocationResponse() error

InvocationResponse call when runtime response is available.

func (*RuntimeRunningState) Name

func (s *RuntimeRunningState) Name() string

Name ...

func (*RuntimeRunningState) Ready

func (s *RuntimeRunningState) Ready() error

func (*RuntimeRunningState) ResponseSent

func (s *RuntimeRunningState) ResponseSent() error

func (*RuntimeRunningState) RestoreError

func (s *RuntimeRunningState) RestoreError(interop.FunctionError) error

func (*RuntimeRunningState) RestoreReady

func (s *RuntimeRunningState) RestoreReady() error

type RuntimeStartedState

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

RuntimeStartedState runtime started state.

func (*RuntimeStartedState) InitError

func (s *RuntimeStartedState) InitError() error

InitError move runtime to init error state.

func (*RuntimeStartedState) InvocationErrorResponse

func (s *RuntimeStartedState) InvocationErrorResponse() error

func (*RuntimeStartedState) InvocationResponse

func (s *RuntimeStartedState) InvocationResponse() error

func (*RuntimeStartedState) Name

func (s *RuntimeStartedState) Name() string

Name ...

func (*RuntimeStartedState) Ready

func (s *RuntimeStartedState) Ready() error

Ready call when runtime init done.

func (*RuntimeStartedState) ResponseSent

func (s *RuntimeStartedState) ResponseSent() error

func (*RuntimeStartedState) RestoreError

func (s *RuntimeStartedState) RestoreError(interop.FunctionError) error

func (*RuntimeStartedState) RestoreReady

func (s *RuntimeStartedState) RestoreReady() error

type RuntimeState

type RuntimeState interface {
	InitError() error
	Ready() error
	RestoreReady() error
	InvocationResponse() error
	InvocationErrorResponse() error
	ResponseSent() error
	RestoreError(interop.FunctionError) error
	Name() string
}

RuntimeState is runtime state machine interface.

type Suspendable

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

Suspendable on operator condition.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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