lang

package
v0.0.0-...-b72ebd3 Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

README

SUMMARY
The language runtime converts linguistic operations
(calling a remote value's method or forking a go
routine remotely) into request-response interactions
with remote runtimes.

I/O:
The ResponseWriter interfaces abstracts away an asynchronous 
request-response architecture with other opaquely 
addressable entities.

ResponseWriter exposes communication over Go runtime interface{}s
to the user. These values passed for these interfaces must
be gob encodable. This design enables an implementation
that allows for maintaining one encoder/decoder per remote
runtime, thereby benefitting from better data compression
over time.

TIMEOUTS:
The I/O infrastructure is responsible for timeing out request/response
interactions if the destination is suspected dead.

If a req/resp pair to a given destination timesout, the destination
is considered ... dead for good?

TYPES AND GOB:
To ensure argument and return values are gob encodable,
their types are registered with gob at the point where their
receiver objects are registered with the circuit
type system.

FLATTENING AND UNFLATTENING
Gob flattens values that are given as input to Encode or that are assigned to
interface variables inside composite types.  For functional arguments and
return values, we can correct for the flattening since we keep the original
type information.  However we cannot do this for interface variables inside
composite types passed as in or out of a function call.

Documentation

Overview

Package lang implements the language runtime

Index

Constants

This section is empty.

Variables

View Source
var ErrParse = NewError("parse")
View Source
var ErrTypeID = NewError("importing handle with unregistered type")

Functions

func IsX

func IsX(v interface{}) bool

func NewBytesConn

func NewBytesConn(addr string) n.Conn

func NewError

func NewError(fmt_ string, arg_ ...interface{}) error

NewError creates a simple text-based error that is serializable

func NewSandbox

func NewSandbox() n.Transport

NewSandbox creates a new transport instance, part of a sandbox network in memory

func PermRef

func PermRef(v interface{}) circuit.PermX

func ReadWriterConn

func ReadWriterConn(addr n.Addr, rwc io.ReadWriteCloser) n.Conn

ReadWriterConn converts an io.ReadWriteCloser into a Conn

func Ref

func Ref(v interface{}) circuit.X

Types

type Runtime

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

Runtime represents that state of the circuit program at the present moment. This state can change in two ways: by a 'linguistic' action ...

func New

func New(t n.Transport) *Runtime

func (*Runtime) Dial

func (r *Runtime) Dial(addr n.Addr, service string) circuit.PermX

Dial returns an ptr to the permanent xvalue of the addressed remote runtime. It panics if any errors get in the way.

func (*Runtime) DialSelf

func (r *Runtime) DialSelf(service string) interface{}

func (*Runtime) Export

func (r *Runtime) Export(val ...interface{}) interface{}

func (*Runtime) Hang

func (r *Runtime) Hang()

func (*Runtime) Import

func (r *Runtime) Import(exported interface{}) ([]interface{}, string, error)

func (*Runtime) Kill

func (r *Runtime) Kill(addr n.Addr) error

func (*Runtime) Listen

func (r *Runtime) Listen(service string, receiver interface{})

func (*Runtime) PermRef

func (*Runtime) PermRef(v interface{}) circuit.PermX

func (*Runtime) Ref

func (*Runtime) Ref(v interface{}) circuit.X

Ref annotates a user value v, so that if the returned value is consequently passed cross-runtime, the runtime will pass v as via a cross-runtime pointer rather than by value.

func (*Runtime) RegisterFunc

func (r *Runtime) RegisterFunc(fn circuit.Func)

func (*Runtime) RegisterValue

func (r *Runtime) RegisterValue(v interface{})

func (*Runtime) RunInBack

func (r *Runtime) RunInBack(fn func())

RunInBack can only be invoked inside a serveGo. For the user, this means that RunInBack can be called inside functions that are invoked via circuit.Spawn

func (*Runtime) ServerAddr

func (r *Runtime) ServerAddr() n.Addr

func (*Runtime) SetBoot

func (r *Runtime) SetBoot(v interface{})

func (*Runtime) Spawn

func (r *Runtime) Spawn(host worker.Host, anchor []string, fn circuit.Func, in ...interface{}) (retrn []interface{}, addr n.Addr, err error)

func (*Runtime) TryDial

func (r *Runtime) TryDial(addr n.Addr, service string) (circuit.PermX, error)

TryDial returns an ptr to the permanent xvalue of the addressed remote runtime

Directories

Path Synopsis
Package prof implements internal profiling data structures
Package prof implements internal profiling data structures
Package types implements the runtime type system
Package types implements the runtime type system

Jump to

Keyboard shortcuts

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