runtime

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2014 License: MIT Imports: 15 Imported by: 16

Documentation

Index

Constants

View Source
const (
	IPTypePacket       byte = 0x00
	IPTypeOpenBracket  byte = 0x01
	IPTypeCloseBracket byte = 0x02
)

Variables

This section is empty.

Functions

func IsCloseBracket

func IsCloseBracket(ip [][]byte) bool

func IsOpenBracket

func IsOpenBracket(ip [][]byte) bool

func IsPacket

func IsPacket(ip [][]byte) bool

func IsValidIP

func IsValidIP(ip [][]byte) bool

func MonitorSocket

func MonitorSocket(socket *zmq.Socket, name string) (<-chan zmq.Event, error)

MonitorSocket creates a monitoring socket using given context and connects to a given socket to be monitored. Returns a channel to receive monitoring events. See event definitions here: http://api.zeromq.org/3-2:zmq-socket-monitor

func NewCloseBracket

func NewCloseBracket() [][]byte

func NewOpenBracket

func NewOpenBracket() [][]byte

func NewPacket

func NewPacket(payload []byte) [][]byte

func SetupShutdownByDisconnect

func SetupShutdownByDisconnect(socket *zmq.Socket, name string, termChannel chan os.Signal) error

This function is a helper shortcut to setup shutdown behavior once an accepted connection closes (disconnects).

Types

type Env

type Env map[string]string

Map of key/values to pass as env variables to a process

type Process

type Process struct {
	Executable  string
	Args        map[string]string
	Env         Env
	Interactive bool
	Stdin       io.Reader
	Stdout      io.Writer
	Stderr      io.Writer
	Root        string
	// contains filtered or unexported fields
}

Process model

func NewProcess

func NewProcess(executable string) (p *Process)

Process constructor

func (*Process) Arguments

func (p *Process) Arguments() string

func (*Process) Command

func (p *Process) Command() string

func (*Process) Pid

func (p *Process) Pid() int

func (*Process) Running

func (p *Process) Running() bool

func (*Process) Signal

func (p *Process) Signal(signal syscall.Signal)

Send signal to a process

func (*Process) Start

func (p *Process) Start()

Start a process

func (*Process) Wait

func (p *Process) Wait()

type ProcessIIP

type ProcessIIP struct {
	Payload string
	Socket  string
}

IIP model (sent when processes started)

type Runtime

type Runtime struct {
	Done  chan bool
	Debug bool
	// contains filtered or unexported fields
}

Runtime structure corresponds to a single network

func NewRuntime

func NewRuntime(registrar library.Registrar, initialTCPPort uint) *Runtime

Runtime constructor

func (*Runtime) Activate

func (self *Runtime) Activate()

Activate network by sending out all IIPs

func (*Runtime) LoadGraph

func (self *Runtime) LoadGraph(graphfile string) error

Loads graph definition in supported format from a given file path

func (*Runtime) PrintGraph

func (self *Runtime) PrintGraph()

Print the current graph for debug purposes

func (*Runtime) Shutdown

func (self *Runtime) Shutdown()

Shutdown the network

func (*Runtime) Start

func (self *Runtime) Start()

Start the network based on the current graph

Jump to

Keyboard shortcuts

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