Documentation ¶
Overview ¶
Package ipc implements a simple IPC system based on VOM.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPC ¶
type IPC struct {
// contains filtered or unexported fields
}
IPC provides interprocess rpcs. One process must act as the "server" by listening for connections. However once connected rpcs can flow in either direction.
func NewIPC ¶
func NewIPC() *IPC
Create a new IPC object. After calling new you can register handlers with Serve(). Then call Listen() or Connect().
func (*IPC) Connect ¶
Connect to a listening socket at 'path'. If timeout is non-zero and the initial connection fails because the socket is not ready, Connect will retry once per second until the timeout expires.
func (*IPC) Connections ¶
Connections returns all the current connections in this IPC.
func (*IPC) IdleStartTime ¶
IdleStartTime returns the time when this IPC became idle (no connections). If there are connections currently, returns the zero time instant.
func (*IPC) Serve ¶
Serve registers rpc handlers. All exported methods in 'x' are registered for rpc. All arguments and results for these methods must be VOM serializable. Additionally each method must have at least one return value, and the final return value must be an 'error'. Serve must be called before Listen() or Connect().
type IPCConn ¶
type IPCConn struct {
// contains filtered or unexported fields
}
IPCConn represents a connection to a process. It can be used to make rpcs to the other process. It also dispatches rpcs from that process to handlers registered with the parent IPC object.
func (*IPCConn) Call ¶
Perform an rpc with the given name and arguments. 'args' must correspond with the method registered in the other process, and results must contain pointers to the return types of the method. All rpc methods must have a final error result, which is not included in 'results'. It is the return value of Call().