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
- Variables
- func ValidateExternalAgentEvent(e Event) error
- func ValidateInternalAgentEvent(e Event) error
- type AgentInfo
- type AgentInfoErrorType
- type Credentials
- type CredentialsService
- type Event
- type ExternalAgent
- func (s *ExternalAgent) ErrorType() string
- func (s *ExternalAgent) ExitError(errorType string) error
- func (s *ExternalAgent) Exited() error
- func (s *ExternalAgent) GetAgentDescription() statejson.ExtensionDescription
- func (s *ExternalAgent) GetState() ExternalAgentState
- func (s *ExternalAgent) InitError(errorType string) error
- func (s *ExternalAgent) IsSubscribed(e Event) bool
- func (s *ExternalAgent) LaunchError(err error) error
- func (s *ExternalAgent) Ready() error
- func (s *ExternalAgent) Register(events []Event) error
- func (s *ExternalAgent) Release()
- func (s *ExternalAgent) SetState(state ExternalAgentState)
- func (s *ExternalAgent) ShutdownFailed() error
- func (s *ExternalAgent) String() string
- func (s *ExternalAgent) SubscribedEvents() []string
- func (s *ExternalAgent) SuspendUnsafe()
- type ExternalAgentExitErrorState
- func (s *ExternalAgentExitErrorState) ExitError(errorType string) error
- func (s *ExternalAgentExitErrorState) Exited() error
- func (s *ExternalAgentExitErrorState) InitError(errorType string) error
- func (s *ExternalAgentExitErrorState) LaunchError(error) error
- func (s *ExternalAgentExitErrorState) Name() string
- func (s *ExternalAgentExitErrorState) Ready() error
- func (s *ExternalAgentExitErrorState) Register(events []Event) error
- func (s *ExternalAgentExitErrorState) ShutdownFailed() error
- type ExternalAgentExitedState
- func (s *ExternalAgentExitedState) ExitError(errorType string) error
- func (s *ExternalAgentExitedState) Exited() error
- func (s *ExternalAgentExitedState) InitError(errorType string) error
- func (s *ExternalAgentExitedState) LaunchError(error) error
- func (s *ExternalAgentExitedState) Name() string
- func (s *ExternalAgentExitedState) Ready() error
- func (s *ExternalAgentExitedState) Register(events []Event) error
- func (s *ExternalAgentExitedState) ShutdownFailed() error
- type ExternalAgentInitErrorState
- func (s *ExternalAgentInitErrorState) ExitError(errorType string) error
- func (s *ExternalAgentInitErrorState) Exited() error
- func (s *ExternalAgentInitErrorState) InitError(errorType string) error
- func (s *ExternalAgentInitErrorState) LaunchError(error) error
- func (s *ExternalAgentInitErrorState) Name() string
- func (s *ExternalAgentInitErrorState) Ready() error
- func (s *ExternalAgentInitErrorState) Register(events []Event) error
- func (s *ExternalAgentInitErrorState) ShutdownFailed() error
- type ExternalAgentLaunchErrorState
- func (s *ExternalAgentLaunchErrorState) ExitError(errorType string) error
- func (s *ExternalAgentLaunchErrorState) Exited() error
- func (s *ExternalAgentLaunchErrorState) InitError(errorType string) error
- func (s *ExternalAgentLaunchErrorState) LaunchError(error) error
- func (s *ExternalAgentLaunchErrorState) Name() string
- func (s *ExternalAgentLaunchErrorState) Ready() error
- func (s *ExternalAgentLaunchErrorState) Register(events []Event) error
- func (s *ExternalAgentLaunchErrorState) ShutdownFailed() error
- type ExternalAgentReadyState
- func (s *ExternalAgentReadyState) ExitError(errorType string) error
- func (s *ExternalAgentReadyState) Exited() error
- func (s *ExternalAgentReadyState) InitError(errorType string) error
- func (s *ExternalAgentReadyState) LaunchError(error) error
- func (s *ExternalAgentReadyState) Name() string
- func (s *ExternalAgentReadyState) Ready() error
- func (s *ExternalAgentReadyState) Register(events []Event) error
- func (s *ExternalAgentReadyState) ShutdownFailed() error
- type ExternalAgentRegisteredState
- func (s *ExternalAgentRegisteredState) ExitError(errorType string) error
- func (s *ExternalAgentRegisteredState) Exited() error
- func (s *ExternalAgentRegisteredState) InitError(errorType string) error
- func (s *ExternalAgentRegisteredState) LaunchError(error) error
- func (s *ExternalAgentRegisteredState) Name() string
- func (s *ExternalAgentRegisteredState) Ready() error
- func (s *ExternalAgentRegisteredState) Register(events []Event) error
- func (s *ExternalAgentRegisteredState) ShutdownFailed() error
- type ExternalAgentRunningState
- func (s *ExternalAgentRunningState) ExitError(errorType string) error
- func (s *ExternalAgentRunningState) Exited() error
- func (s *ExternalAgentRunningState) InitError(errorType string) error
- func (s *ExternalAgentRunningState) LaunchError(error) error
- func (s *ExternalAgentRunningState) Name() string
- func (s *ExternalAgentRunningState) Ready() error
- func (s *ExternalAgentRunningState) Register(events []Event) error
- func (s *ExternalAgentRunningState) ShutdownFailed() error
- type ExternalAgentShutdownFailedState
- func (s *ExternalAgentShutdownFailedState) ExitError(errorType string) error
- func (s *ExternalAgentShutdownFailedState) Exited() error
- func (s *ExternalAgentShutdownFailedState) InitError(errorType string) error
- func (s *ExternalAgentShutdownFailedState) LaunchError(error) error
- func (s *ExternalAgentShutdownFailedState) Name() string
- func (s *ExternalAgentShutdownFailedState) Ready() error
- func (s *ExternalAgentShutdownFailedState) Register(events []Event) error
- func (s *ExternalAgentShutdownFailedState) ShutdownFailed() error
- type ExternalAgentStartedState
- func (s *ExternalAgentStartedState) ExitError(errorType string) error
- func (s *ExternalAgentStartedState) Exited() error
- func (s *ExternalAgentStartedState) InitError(errorType string) error
- func (s *ExternalAgentStartedState) LaunchError(err error) error
- func (s *ExternalAgentStartedState) Name() string
- func (s *ExternalAgentStartedState) Ready() error
- func (s *ExternalAgentStartedState) Register(events []Event) error
- func (s *ExternalAgentStartedState) ShutdownFailed() error
- type ExternalAgentState
- type ExternalAgentsMap
- func (m *ExternalAgentsMap) AsArray() []*ExternalAgent
- func (m *ExternalAgentsMap) Clear()
- func (m *ExternalAgentsMap) FindByID(id uuid.UUID) (agent *ExternalAgent, found bool)
- func (m *ExternalAgentsMap) FindByName(name string) (agent *ExternalAgent, found bool)
- func (m *ExternalAgentsMap) Insert(a *ExternalAgent) error
- func (m *ExternalAgentsMap) Size() int
- func (m *ExternalAgentsMap) Visit(cb func(*ExternalAgent))
- type FunctionMetadata
- type Gate
- type InitFlowSynchronization
- type InternalAgent
- func (s *InternalAgent) ErrorType() string
- func (s *InternalAgent) ExitError(errorType string) error
- func (s *InternalAgent) GetAgentDescription() statejson.ExtensionDescription
- func (s *InternalAgent) GetState() InternalAgentState
- func (s *InternalAgent) InitError(errorType string) error
- func (s *InternalAgent) IsSubscribed(e Event) bool
- func (s *InternalAgent) Ready() error
- func (s *InternalAgent) Register(events []Event) error
- func (s *InternalAgent) Release()
- func (s *InternalAgent) SetState(state InternalAgentState)
- func (s *InternalAgent) String() string
- func (s *InternalAgent) SubscribedEvents() []string
- func (s *InternalAgent) SuspendUnsafe()
- type InternalAgentExitErrorState
- func (s *InternalAgentExitErrorState) ExitError(errorType string) error
- func (s *InternalAgentExitErrorState) Exited() error
- func (s *InternalAgentExitErrorState) InitError(errorType string) error
- func (s *InternalAgentExitErrorState) LaunchError(error) error
- func (s *InternalAgentExitErrorState) Name() string
- func (s *InternalAgentExitErrorState) Ready() error
- func (s *InternalAgentExitErrorState) Register(events []Event) error
- func (s *InternalAgentExitErrorState) ShutdownFailed() error
- type InternalAgentInitErrorState
- func (s *InternalAgentInitErrorState) ExitError(errorType string) error
- func (s *InternalAgentInitErrorState) Exited() error
- func (s *InternalAgentInitErrorState) InitError(errorType string) error
- func (s *InternalAgentInitErrorState) LaunchError(error) error
- func (s *InternalAgentInitErrorState) Name() string
- func (s *InternalAgentInitErrorState) Ready() error
- func (s *InternalAgentInitErrorState) Register(events []Event) error
- func (s *InternalAgentInitErrorState) ShutdownFailed() error
- type InternalAgentReadyState
- func (s *InternalAgentReadyState) ExitError(errorType string) error
- func (s *InternalAgentReadyState) Exited() error
- func (s *InternalAgentReadyState) InitError(errorType string) error
- func (s *InternalAgentReadyState) LaunchError(error) error
- func (s *InternalAgentReadyState) Name() string
- func (s *InternalAgentReadyState) Ready() error
- func (s *InternalAgentReadyState) Register(events []Event) error
- func (s *InternalAgentReadyState) ShutdownFailed() error
- type InternalAgentRegisteredState
- func (s *InternalAgentRegisteredState) ExitError(errorType string) error
- func (s *InternalAgentRegisteredState) Exited() error
- func (s *InternalAgentRegisteredState) InitError(errorType string) error
- func (s *InternalAgentRegisteredState) LaunchError(error) error
- func (s *InternalAgentRegisteredState) Name() string
- func (s *InternalAgentRegisteredState) Ready() error
- func (s *InternalAgentRegisteredState) Register(events []Event) error
- func (s *InternalAgentRegisteredState) ShutdownFailed() error
- type InternalAgentRunningState
- func (s *InternalAgentRunningState) ExitError(errorType string) error
- func (s *InternalAgentRunningState) Exited() error
- func (s *InternalAgentRunningState) InitError(errorType string) error
- func (s *InternalAgentRunningState) LaunchError(error) error
- func (s *InternalAgentRunningState) Name() string
- func (s *InternalAgentRunningState) Ready() error
- func (s *InternalAgentRunningState) Register(events []Event) error
- func (s *InternalAgentRunningState) ShutdownFailed() error
- type InternalAgentStartedState
- func (s *InternalAgentStartedState) ExitError(errorType string) error
- func (s *InternalAgentStartedState) Exited() error
- func (s *InternalAgentStartedState) InitError(errorType string) error
- func (s *InternalAgentStartedState) LaunchError(error) error
- func (s *InternalAgentStartedState) Name() string
- func (s *InternalAgentStartedState) Ready() error
- func (s *InternalAgentStartedState) Register(events []Event) error
- func (s *InternalAgentStartedState) ShutdownFailed() error
- type InternalAgentState
- type InternalAgentsMap
- func (m *InternalAgentsMap) AsArray() []*InternalAgent
- func (m *InternalAgentsMap) Clear()
- func (m *InternalAgentsMap) FindByID(id uuid.UUID) (agent *InternalAgent, found bool)
- func (m *InternalAgentsMap) FindByName(name string) (agent *InternalAgent, found bool)
- func (m *InternalAgentsMap) Insert(a *InternalAgent) error
- func (m *InternalAgentsMap) Size() int
- func (m *InternalAgentsMap) Visit(cb func(*InternalAgent))
- type InvokeFlowSynchronization
- type ManagedThread
- type RegistrationService
- type Runtime
- func (s *Runtime) GetRuntimeDescription() statejson.RuntimeDescription
- func (s *Runtime) GetState() RuntimeState
- func (s *Runtime) InitError() error
- func (s *Runtime) InvocationErrorResponse() error
- func (s *Runtime) InvocationResponse() error
- func (s *Runtime) Ready() error
- func (s *Runtime) Release()
- func (s *Runtime) ResponseSent() error
- func (s *Runtime) RestoreError(UserError interop.FunctionError) error
- func (s *Runtime) RestoreReady() error
- func (s *Runtime) SetState(state RuntimeState)
- type RuntimeInitErrorState
- func (s *RuntimeInitErrorState) InitError() error
- func (s *RuntimeInitErrorState) InvocationErrorResponse() error
- func (s *RuntimeInitErrorState) InvocationResponse() error
- func (s *RuntimeInitErrorState) Name() string
- func (s *RuntimeInitErrorState) Ready() error
- func (s *RuntimeInitErrorState) ResponseSent() error
- func (s *RuntimeInitErrorState) RestoreError(interop.FunctionError) error
- func (s *RuntimeInitErrorState) RestoreReady() error
- type RuntimeInvocationErrorResponseState
- func (s *RuntimeInvocationErrorResponseState) InitError() error
- func (s *RuntimeInvocationErrorResponseState) InvocationErrorResponse() error
- func (s *RuntimeInvocationErrorResponseState) InvocationResponse() error
- func (s *RuntimeInvocationErrorResponseState) Name() string
- func (s *RuntimeInvocationErrorResponseState) Ready() error
- func (s *RuntimeInvocationErrorResponseState) ResponseSent() error
- func (s *RuntimeInvocationErrorResponseState) RestoreError(interop.FunctionError) error
- func (s *RuntimeInvocationErrorResponseState) RestoreReady() error
- type RuntimeInvocationResponseState
- func (s *RuntimeInvocationResponseState) InitError() error
- func (s *RuntimeInvocationResponseState) InvocationErrorResponse() error
- func (s *RuntimeInvocationResponseState) InvocationResponse() error
- func (s *RuntimeInvocationResponseState) Name() string
- func (s *RuntimeInvocationResponseState) Ready() error
- func (s *RuntimeInvocationResponseState) ResponseSent() error
- func (s *RuntimeInvocationResponseState) RestoreError(interop.FunctionError) error
- func (s *RuntimeInvocationResponseState) RestoreReady() error
- type RuntimeReadyState
- func (s *RuntimeReadyState) InitError() error
- func (s *RuntimeReadyState) InvocationErrorResponse() error
- func (s *RuntimeReadyState) InvocationResponse() error
- func (s *RuntimeReadyState) Name() string
- func (s *RuntimeReadyState) Ready() error
- func (s *RuntimeReadyState) ResponseSent() error
- func (s *RuntimeReadyState) RestoreError(interop.FunctionError) error
- func (s *RuntimeReadyState) RestoreReady() error
- type RuntimeResponseSentState
- func (s *RuntimeResponseSentState) InitError() error
- func (s *RuntimeResponseSentState) InvocationErrorResponse() error
- func (s *RuntimeResponseSentState) InvocationResponse() error
- func (s *RuntimeResponseSentState) Name() string
- func (s *RuntimeResponseSentState) Ready() error
- func (s *RuntimeResponseSentState) ResponseSent() error
- func (s *RuntimeResponseSentState) RestoreError(interop.FunctionError) error
- func (s *RuntimeResponseSentState) RestoreReady() error
- type RuntimeRestoreErrorState
- func (s *RuntimeRestoreErrorState) InitError() error
- func (s *RuntimeRestoreErrorState) InvocationErrorResponse() error
- func (s *RuntimeRestoreErrorState) InvocationResponse() error
- func (s *RuntimeRestoreErrorState) Name() string
- func (s *RuntimeRestoreErrorState) Ready() error
- func (s *RuntimeRestoreErrorState) ResponseSent() error
- func (s *RuntimeRestoreErrorState) RestoreError(interop.FunctionError) error
- func (s *RuntimeRestoreErrorState) RestoreReady() error
- type RuntimeRestoreReadyState
- func (s *RuntimeRestoreReadyState) InitError() error
- func (s *RuntimeRestoreReadyState) InvocationErrorResponse() error
- func (s *RuntimeRestoreReadyState) InvocationResponse() error
- func (s *RuntimeRestoreReadyState) Name() string
- func (s *RuntimeRestoreReadyState) Ready() error
- func (s *RuntimeRestoreReadyState) ResponseSent() error
- func (s *RuntimeRestoreReadyState) RestoreError(interop.FunctionError) error
- func (s *RuntimeRestoreReadyState) RestoreReady() error
- type RuntimeRestoringState
- func (s *RuntimeRestoringState) InitError() error
- func (s *RuntimeRestoringState) InvocationErrorResponse() error
- func (s *RuntimeRestoringState) InvocationResponse() error
- func (s *RuntimeRestoringState) Name() string
- func (s *RuntimeRestoringState) Ready() error
- func (s *RuntimeRestoringState) ResponseSent() error
- func (s *RuntimeRestoringState) RestoreError(userError interop.FunctionError) error
- func (s *RuntimeRestoringState) RestoreReady() error
- type RuntimeRunningState
- func (s *RuntimeRunningState) InitError() error
- func (s *RuntimeRunningState) InvocationErrorResponse() error
- func (s *RuntimeRunningState) InvocationResponse() error
- func (s *RuntimeRunningState) Name() string
- func (s *RuntimeRunningState) Ready() error
- func (s *RuntimeRunningState) ResponseSent() error
- func (s *RuntimeRunningState) RestoreError(interop.FunctionError) error
- func (s *RuntimeRunningState) RestoreReady() error
- type RuntimeStartedState
- func (s *RuntimeStartedState) InitError() error
- func (s *RuntimeStartedState) InvocationErrorResponse() error
- func (s *RuntimeStartedState) InvocationResponse() error
- func (s *RuntimeStartedState) Name() string
- func (s *RuntimeStartedState) Ready() error
- func (s *RuntimeStartedState) ResponseSent() error
- func (s *RuntimeStartedState) RestoreError(interop.FunctionError) error
- func (s *RuntimeStartedState) RestoreReady() error
- type RuntimeState
- type Suspendable
Constants ¶
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
const ( UNBLOCKED = iota BLOCKED )
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
const MaxAgentsAllowed = 10
Variables ¶
var ErrAgentIDCollision = errors.New("ErrAgentIDCollision")
ErrAgentIDCollision means that agent with the same ID already exists in AgentsMap
var ErrAgentNameCollision = errors.New("ErrAgentNameCollision")
ErrAgentNameCollision means that agent with the same name already exists in AgentsMap
var ErrConcurrentStateModification = errors.New("Concurrent state modification")
ErrConcurrentStateModification returned when we've detected an invalid state transision caused by concurrent modification
var ErrCredentialsNotFound = fmt.Errorf("credentials not found for the provided token")
var ErrGateCanceled = errors.New("ErrGateCanceled")
ErrGateCanceled ...
var ErrGateIntegrity = errors.New("ErrGateIntegrity")
ErrGateIntegrity ...
var ErrNotAllowed = errors.New("State transition is not allowed")
ErrNotAllowed returned on illegal state transition
var ErrRegistrationServiceOff = errors.New("ErrRegistrationServiceOff")
ErrRegistrationServiceOff returned on attempt to register after registration service has been turned off.
var ErrTooManyExtensions = errors.New("ErrTooManyExtensions")
ErrTooManyExtensions means MaxAgentsAllowed limit is exceeded
Functions ¶
Types ¶
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 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 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) 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) LaunchError ¶
LaunchError
func (*ExternalAgentExitErrorState) Name ¶
func (s *ExternalAgentExitErrorState) Name() string
Name return state's human friendly name
func (*ExternalAgentExitErrorState) Ready ¶
func (s *ExternalAgentExitErrorState) Ready() error
Ready
func (*ExternalAgentExitErrorState) ShutdownFailed ¶
func (s *ExternalAgentExitErrorState) ShutdownFailed() error
ShutdownFailed
type ExternalAgentExitedState ¶
type ExternalAgentExitedState struct {
// contains filtered or unexported fields
}
func (*ExternalAgentExitedState) LaunchError ¶
LaunchError
func (*ExternalAgentExitedState) Name ¶
func (s *ExternalAgentExitedState) Name() string
Name return state's human friendly name
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) 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 ¶
LaunchError
func (*ExternalAgentInitErrorState) Name ¶
func (s *ExternalAgentInitErrorState) Name() string
Name return state's human friendly name
func (*ExternalAgentInitErrorState) Ready ¶
func (s *ExternalAgentInitErrorState) Ready() error
Ready
func (*ExternalAgentInitErrorState) ShutdownFailed ¶
func (s *ExternalAgentInitErrorState) ShutdownFailed() error
ShutdownFailed
type ExternalAgentLaunchErrorState ¶
type ExternalAgentLaunchErrorState struct {
// contains filtered or unexported fields
}
func (*ExternalAgentLaunchErrorState) Exited ¶
func (s *ExternalAgentLaunchErrorState) Exited() error
Exited
func (*ExternalAgentLaunchErrorState) LaunchError ¶
LaunchError
func (*ExternalAgentLaunchErrorState) Name ¶
func (s *ExternalAgentLaunchErrorState) Name() string
Name return state's human friendly name
func (*ExternalAgentLaunchErrorState) Ready ¶
func (s *ExternalAgentLaunchErrorState) Ready() error
Ready
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) LaunchError ¶
LaunchError
func (*ExternalAgentReadyState) Name ¶
func (s *ExternalAgentReadyState) Name() string
Name return state's human friendly name
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 ¶
LaunchError
func (*ExternalAgentRegisteredState) Name ¶
func (s *ExternalAgentRegisteredState) Name() string
Name return state's human friendly name
func (*ExternalAgentRegisteredState) Ready ¶
func (s *ExternalAgentRegisteredState) Ready() error
Ready - agent has called next and is now successfully initialized
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) LaunchError ¶
LaunchError
func (*ExternalAgentRunningState) Name ¶
func (s *ExternalAgentRunningState) Name() string
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) 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) Exited ¶
func (s *ExternalAgentShutdownFailedState) Exited() error
Exited
func (*ExternalAgentShutdownFailedState) LaunchError ¶
LaunchError
func (*ExternalAgentShutdownFailedState) Name ¶
func (s *ExternalAgentShutdownFailedState) Name() string
Name return state's human friendly name
func (*ExternalAgentShutdownFailedState) Ready ¶
func (s *ExternalAgentShutdownFailedState) Ready() error
Ready
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) Exited ¶
func (s *ExternalAgentStartedState) Exited() error
Exited
func (*ExternalAgentStartedState) LaunchError ¶
func (s *ExternalAgentStartedState) LaunchError(err error) error
LaunchError signals that agent could not launch (non-exec/permission denied)
func (*ExternalAgentStartedState) Name ¶
func (s *ExternalAgentStartedState) Name() string
Name return state's human friendly name
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 ...
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) 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) LaunchError ¶
LaunchError
func (*InternalAgentExitErrorState) Name ¶
func (s *InternalAgentExitErrorState) Name() string
Name return state's human friendly name
func (*InternalAgentExitErrorState) Ready ¶
func (s *InternalAgentExitErrorState) Ready() error
Ready
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) 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 ¶
LaunchError
func (*InternalAgentInitErrorState) Name ¶
func (s *InternalAgentInitErrorState) Name() string
Name return state's human friendly name
func (*InternalAgentInitErrorState) Ready ¶
func (s *InternalAgentInitErrorState) Ready() error
Ready
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) LaunchError ¶
LaunchError
func (*InternalAgentReadyState) Name ¶
func (s *InternalAgentReadyState) Name() string
Name return state's human friendly name
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 ¶
LaunchError
func (*InternalAgentRegisteredState) Name ¶
func (s *InternalAgentRegisteredState) Name() string
Name return state's human friendly name
func (*InternalAgentRegisteredState) Ready ¶
func (s *InternalAgentRegisteredState) Ready() error
Ready - agent has called next and is now successfully initialized
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) LaunchError ¶
LaunchError
func (*InternalAgentRunningState) Name ¶
func (s *InternalAgentRunningState) Name() string
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) 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) Exited ¶
func (s *InternalAgentStartedState) Exited() error
Exited
func (*InternalAgentStartedState) LaunchError ¶
LaunchError
func (*InternalAgentStartedState) Name ¶
func (s *InternalAgentStartedState) Name() string
Name return state's human friendly name
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) 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
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) InvocationErrorResponse ¶
InvocationErrorResponse delegates to state implementation.
func (*Runtime) InvocationResponse ¶
InvocationResponse delegates to state implementation.
func (*Runtime) ResponseSent ¶
ResponseSent delegates to state implementation.
func (*Runtime) RestoreError ¶
func (s *Runtime) RestoreError(UserError interop.FunctionError) error
func (*Runtime) RestoreReady ¶
type RuntimeInitErrorState ¶
type RuntimeInitErrorState struct {
// contains filtered or unexported fields
}
RuntimeInitErrorState runtime started state.
func (*RuntimeInitErrorState) InvocationErrorResponse ¶
func (s *RuntimeInitErrorState) InvocationErrorResponse() error
func (*RuntimeInitErrorState) InvocationResponse ¶
func (s *RuntimeInitErrorState) InvocationResponse() 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 ¶
func (s *RuntimeInvocationErrorResponseState) Name() string
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 ¶
func (s *RuntimeInvocationResponseState) Name() string
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) InvocationErrorResponse ¶
func (s *RuntimeReadyState) InvocationErrorResponse() error
func (*RuntimeReadyState) InvocationResponse ¶
func (s *RuntimeReadyState) InvocationResponse() error
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) InvocationErrorResponse ¶
func (s *RuntimeResponseSentState) InvocationErrorResponse() error
func (*RuntimeResponseSentState) InvocationResponse ¶
func (s *RuntimeResponseSentState) InvocationResponse() error
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) InvocationErrorResponse ¶
func (s *RuntimeRestoreErrorState) InvocationErrorResponse() error
func (*RuntimeRestoreErrorState) InvocationResponse ¶
func (s *RuntimeRestoreErrorState) InvocationResponse() error
func (*RuntimeRestoreErrorState) Name ¶
func (s *RuntimeRestoreErrorState) Name() string
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) InvocationErrorResponse ¶
func (s *RuntimeRestoreReadyState) InvocationErrorResponse() error
func (*RuntimeRestoreReadyState) InvocationResponse ¶
func (s *RuntimeRestoreReadyState) InvocationResponse() error
func (*RuntimeRestoreReadyState) Name ¶
func (s *RuntimeRestoreReadyState) Name() string
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) 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) 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) 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) 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.