runtime

package
v0.0.0-...-f7ae98d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) GetConfiguration

func (ar *AbstractRuntime) GetConfiguration() *Configuration

GetConfiguration returns the runtime configuration

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) SetStatus

func (ar *AbstractRuntime) SetStatus(newStatus status.Status)

SetStatus sets the runtime's reported status

func (*AbstractRuntime) Stop

func (ar *AbstractRuntime) Stop() error

Stop stops the runtime

type Configuration

type Configuration struct {
	*processor.Configuration
	FunctionLogger logger.Logger
	WorkerID       int
}

type Creator

type Creator interface {

	// Create creates a runtime instance
	Create(logger.Logger, *Configuration) (Runtime, error)
}

Creator creates a runtime instance

type Registry

type Registry struct {
	registry.Registry
}

func (*Registry) NewRuntime

func (r *Registry) NewRuntime(logger logger.Logger,
	kind string,
	runtimeConfiguration *Configuration) (Runtime, error)

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)

	// 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

	// Stop stops the runtime
	Stop() error
}

Runtime receives an event from a worker and passes it to a specific runtime like Golang, Python, et

type Statistics

type Statistics struct {
	DurationMilliSecondsSum   uint64
	DurationMilliSecondsCount uint64
}

func (*Statistics) DiffFrom

func (s *Statistics) DiffFrom(prev *Statistics) Statistics

Directories

Path Synopsis
test/_outputter command
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

Jump to

Keyboard shortcuts

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