Documentation
¶
Index ¶
- Variables
- type AbstractRuntime
- func (ar *AbstractRuntime) Continue() error
- func (ar *AbstractRuntime) Drain() error
- func (ar *AbstractRuntime) GetConfiguration() *Configuration
- func (ar *AbstractRuntime) GetControlMessageBroker() controlcommunication.ControlMessageBroker
- func (ar *AbstractRuntime) GetEnvFromConfiguration() []string
- func (ar *AbstractRuntime) GetFunctionLogger() logger.Logger
- func (ar *AbstractRuntime) GetStatistics() *Statistics
- func (ar *AbstractRuntime) GetStatus() status.Status
- func (ar *AbstractRuntime) Restart() error
- func (ar *AbstractRuntime) SetStatus(newStatus status.Status)
- func (ar *AbstractRuntime) Start() error
- func (ar *AbstractRuntime) Stop() error
- func (ar *AbstractRuntime) SupportsControlCommunication() bool
- func (ar *AbstractRuntime) SupportsRestart() bool
- func (ar *AbstractRuntime) Terminate() error
- type Configuration
- type Creator
- type Registry
- type ResponseWithErrors
- type Runtime
- type Statistics
Constants ¶
This section is empty.
Variables ¶
var ErrNoResponseFromBatchResponse = errors.New("processor hasn't received corresponding response for the event")
var RegistrySingleton = Registry{ Registry: *registry.NewRegistry("runtime"), }
global singleton
Functions ¶
This section is empty.
Types ¶
type AbstractRuntime ¶
type AbstractRuntime struct { Logger logger.Logger FunctionLogger logger.Logger Context *nuclio.Context Statistics Statistics // contains filtered or unexported fields }
AbstractRuntime is the base for all runtimes
func NewAbstractRuntime ¶
func NewAbstractRuntime(logger logger.Logger, configuration *Configuration) (*AbstractRuntime, error)
NewAbstractRuntime creates a new abstract runtime
func (*AbstractRuntime) Continue ¶
func (ar *AbstractRuntime) Continue() error
func (*AbstractRuntime) Drain ¶
func (ar *AbstractRuntime) Drain() error
func (*AbstractRuntime) GetConfiguration ¶
func (ar *AbstractRuntime) GetConfiguration() *Configuration
GetConfiguration returns the runtime configuration
func (*AbstractRuntime) GetControlMessageBroker ¶
func (ar *AbstractRuntime) GetControlMessageBroker() controlcommunication.ControlMessageBroker
GetControlMessageBroker returns the control message broker
func (*AbstractRuntime) GetEnvFromConfiguration ¶
func (ar *AbstractRuntime) GetEnvFromConfiguration() []string
func (*AbstractRuntime) GetFunctionLogger ¶
func (ar *AbstractRuntime) GetFunctionLogger() logger.Logger
GetFunctionLogger returns the function logger
func (*AbstractRuntime) GetStatistics ¶
func (ar *AbstractRuntime) GetStatistics() *Statistics
GetStatistics returns statistics gathered by the runtime
func (*AbstractRuntime) GetStatus ¶
func (ar *AbstractRuntime) GetStatus() status.Status
GetStatus returns the runtime's reported status
func (*AbstractRuntime) Restart ¶
func (ar *AbstractRuntime) Restart() error
Restart restarts the runtime
func (*AbstractRuntime) SetStatus ¶
func (ar *AbstractRuntime) SetStatus(newStatus status.Status)
SetStatus sets the runtime's reported status
func (*AbstractRuntime) Start ¶
func (ar *AbstractRuntime) Start() error
Start starts the runtime, or does nothing if the runtime does not require starting (e.g. Go and shell runtimes)
func (*AbstractRuntime) SupportsControlCommunication ¶
func (ar *AbstractRuntime) SupportsControlCommunication() bool
SupportsControlCommunication returns true if the runtime supports control communication
func (*AbstractRuntime) SupportsRestart ¶
func (ar *AbstractRuntime) SupportsRestart() bool
SupportsRestart returns true if the runtime supports restart
func (*AbstractRuntime) Terminate ¶
func (ar *AbstractRuntime) Terminate() error
type Configuration ¶
type Configuration struct { *processor.Configuration FunctionLogger logger.Logger WorkerID int TriggerName string TriggerKind string WorkerTerminationTimeout time.Duration ControlMessageBroker *controlcommunication.AbstractControlMessageBroker Mode functionconfig.TriggerWorkMode AsyncConfig *functionconfig.AsyncConfig }
type Creator ¶
type Creator interface { // Create creates a runtime instance Create(logger.Logger, *Configuration) (Runtime, error) }
Creator creates a runtime instance
type Registry ¶
func (*Registry) NewRuntime ¶
type ResponseWithErrors ¶
type Runtime ¶
type Runtime interface { // ProcessEvent receives the event and processes it at the specific runtime ProcessEvent(event nuclio.Event, functionLogger logger.Logger) (interface{}, error) // ProcessBatch receives the event batch and processes it at the specific runtime ProcessBatch(batch []nuclio.Event, functionLogger logger.Logger) ([]*ResponseWithErrors, error) // GetFunctionLogger returns the function logger GetFunctionLogger() logger.Logger // GetStatistics returns statistics gathered by the runtime GetStatistics() *Statistics // GetConfiguration returns the runtime configuration GetConfiguration() *Configuration // SetStatus sets the runtime's reported status SetStatus(newStatus status.Status) // GetStatus returns the runtime's reported status GetStatus() status.Status // Start starts the runtime, or does nothing if the runtime does not require starting (e.g. Go and shell runtimes) Start() error // Stop stops the runtime Stop() error // Restart restarts the runtime Restart() error // SupportsRestart return true if the runtime supports restart SupportsRestart() bool // Drain signals to the runtime process to drain its accumulated events and waits for it to finish Drain() error // Continue signals the runtime process to continue event processing Continue() error // Terminate signals to the runtime process that processor is about to stop working Terminate() error // GetControlMessageBroker returns the control message broker GetControlMessageBroker() controlcommunication.ControlMessageBroker }
Runtime receives an event from a worker and passes it to a specific runtime like Golang, Python, et
type Statistics ¶
func (*Statistics) DiffFrom ¶
func (s *Statistics) DiffFrom(prev *Statistics) Statistics
Directories
¶
Path | Synopsis |
---|---|
Package java implements a Java runtime
|
Package java implements a Java runtime |
Package nodejs implements nodejs runtime
|
Package nodejs implements nodejs runtime |
Package rpc implmenets Python runtime
|
Package rpc implmenets Python runtime |