Documentation
¶
Overview ¶
Package provides channel-like semantics over a TCP connection using net/rpc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RPChan ¶ added in v0.2.1
type RPChan[T any] struct { // contains filtered or unexported fields }
RPChan
func New ¶ added in v0.2.0
New creates an RPChan[T] over addr, with an optional buffer, and returns a reference to it.
The returned RPChan[T] will not start a client nor a server unless their related methods are called, RPChan.Send and RPChan.Receive or RPChan.Listen, respectively.
func (*RPChan[T]) Close ¶ added in v0.3.0
Close implements the close built-in.
Since closing involves I/O, it can return an error containing the RPC client's Close() error and/or the TCP listener Close() error.
func (*RPChan[T]) Listen ¶ added in v0.4.0
Listen implements a GOEXPERIMENT=rangefunc iterator.
When used in a for-range loop it works exacly like a Go channel.
func (*RPChan[T]) Receive ¶ added in v0.2.1
Receive implements Go channels' receive operation.
A call to Receive, much like receiving over a Go channel, may block. The first call to Receive may error on listening on the TCP address of RPChan.
Since this may involve a network call, Receive can return an error.