Documentation
¶
Overview ¶
Package rpcserver contains implementations for net rpc server.
Package rpcserver contains implementations for net rpc server.
Package rpcserver contains implementations for net rpc server.
Package rpcserver contains implementations for net rpc server.
Package rpcserver contains implementations for net rpc server.
Package rpcserver contains implementations for net rpc server.
Package rpcserver contains implementations for net rpc server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID string
ID defines a pseudo random number that is used to identify RPC subscriptions.
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier is tight to a RPC connection that supports subscriptions. Server callbacks use the notifier to send notifications.
func NotifierFromContext ¶
NotifierFromContext returns the Notifier value stored in ctx, if any.
func (*Notifier) Closed ¶
func (n *Notifier) Closed() <-chan interface{}
Closed returns a channel that is closed when the RPC connection is closed.
func (*Notifier) CreateSubscription ¶
func (n *Notifier) CreateSubscription() *Subscription
CreateSubscription returns a new subscription that is coupled to the RPC connection. By default subscriptions are inactive and notifications are dropped until the subscription is marked as active. This is done by the RPC server after the subscription ID is send to the client.
type RpcApi ¶
type RpcApi struct { Namespace string // namespace under which the rpc methods of Service are exposed Version string // api version Service interface{} // receiver instance which holds the methods }
RpcApi describes the set of methods offered over the RPC interface
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a RPC server
func (*Server) ListenAndServe ¶
func (srv *Server) ListenAndServe()
ListenAndServe starts the request handler loop
func (*Server) RegisterApis ¶
RegisterApis register api for server
type Subscription ¶
type Subscription struct { ID ID // contains filtered or unexported fields }
a Subscription is created by a notifier and tight to that notifier. The client can use this subscription to wait for an unsubscribe request for the client, see Err().
func (*Subscription) Err ¶
func (s *Subscription) Err() <-chan error
Err returns a channel that is closed when the client send an unsubscribe request.