rpc

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: 15 Imported by: 0

Documentation

Overview

Package rpc implmenets Python runtime

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbstractRuntime

type AbstractRuntime struct {
	runtime.AbstractRuntime
	// contains filtered or unexported fields
}

Runtime is a runtime that communicates via unix domain socket

func NewAbstractRuntime

func NewAbstractRuntime(logger logger.Logger,
	configuration *runtime.Configuration,
	runtimeInstance Runtime) (*AbstractRuntime, error)

NewRPCRuntime returns a new RPC runtime

func (*AbstractRuntime) GetSocketType

func (r *AbstractRuntime) GetSocketType() SocketType

GetSocketType returns the type of socket the runtime works with (unix/tcp)

func (*AbstractRuntime) ProcessEvent

func (r *AbstractRuntime) ProcessEvent(event nuclio.Event, functionLogger logger.Logger) (interface{}, error)

ProcessEvent processes an event

func (*AbstractRuntime) Stop

func (r *AbstractRuntime) Stop() error

Stop stops the runtime

func (*AbstractRuntime) WaitForStart

func (r *AbstractRuntime) WaitForStart() bool

WaitForStart returns whether the runtime supports sending an indication that it started

type EventJSONEncoder

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

EventJSONEncoder encodes nuclio events as JSON

func NewEventJSONEncoder

func NewEventJSONEncoder(logger logger.Logger, writer io.Writer) *EventJSONEncoder

NewEventJSONEncoder returns a new JSONEncoder

func (*EventJSONEncoder) Encode

func (je *EventJSONEncoder) Encode(event nuclio.Event) error

Encode writes the JSON encoding of event to the stream, followed by a newline character

type Runtime

type Runtime interface {

	// RunWrapper runs the wrapper
	RunWrapper(string) (*os.Process, error)

	// GetSocketType returns the type of socket the runtime works with (unix/tcp)
	GetSocketType() SocketType

	// WaitForStart returns whether the runtime supports sending an indication that it started
	WaitForStart() bool
}

type SocketType

type SocketType int

SocketType is type of socket to use

const (
	UnixSocket SocketType = iota
	TCPSocket
)

RPC socket types

Jump to

Keyboard shortcuts

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