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 ¶
- Variables
- func IsX(v interface{}) bool
- func NewBytesConn(addr string) n.Conn
- func NewError(fmt_ string, arg_ ...interface{}) error
- func NewSandbox() n.Transport
- func PermRef(v interface{}) circuit.PermX
- func ReadWriterConn(addr n.Addr, rwc io.ReadWriteCloser) n.Conn
- func Ref(v interface{}) circuit.X
- type Runtime
- func (r *Runtime) Dial(addr n.Addr, service string) circuit.PermX
- func (r *Runtime) DialSelf(service string) interface{}
- func (r *Runtime) Export(val ...interface{}) interface{}
- func (r *Runtime) Hang()
- func (r *Runtime) Import(exported interface{}) ([]interface{}, string, error)
- func (r *Runtime) Kill(addr n.Addr) error
- func (r *Runtime) Listen(service string, receiver interface{})
- func (*Runtime) PermRef(v interface{}) circuit.PermX
- func (*Runtime) Ref(v interface{}) circuit.X
- func (r *Runtime) RegisterFunc(fn circuit.Func)
- func (r *Runtime) RegisterValue(v interface{})
- func (r *Runtime) RunInBack(fn func())
- func (r *Runtime) ServerAddr() n.Addr
- func (r *Runtime) SetBoot(v interface{})
- func (r *Runtime) Spawn(host worker.Host, anchor []string, fn circuit.Func, in ...interface{}) (retrn []interface{}, addr n.Addr, err error)
- func (r *Runtime) TryDial(addr n.Addr, service string) (circuit.PermX, error)
Constants ¶
This section is empty.
Variables ¶
var ErrParse = NewError("parse")
var ErrTypeID = NewError("importing handle with unregistered type")
Functions ¶
func NewBytesConn ¶
func NewSandbox ¶
NewSandbox creates a new transport instance, part of a sandbox network in memory
func ReadWriterConn ¶
ReadWriterConn converts an io.ReadWriteCloser into a Conn
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 (*Runtime) Dial ¶
Dial returns an ptr to the permanent xvalue of the addressed remote runtime. It panics if any errors get in the way.
func (*Runtime) Ref ¶
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 (*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