zrpc

package module
v0.0.0-...-804e331 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 7 Imported by: 0

README

zrpc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*rpc.Client
}

func NewClient

func NewClient(conn io.ReadWriteCloser, opt *Options) *Client

NewClient Create a new rpc client

func (*Client) AsyncCall

func (c *Client) AsyncCall(serviceMethod string, args interface{}, reply interface{}) chan *rpc.Call

AsyncCall asynchronously calls the rpc function and returns a channel of *rpc.Call

func (*Client) Call

func (c *Client) Call(serviceMethod string, args interface{}, reply interface{}) error

Call synchronously calls the rpc function

type Options

type Options struct {
	SerializeType serialize.Type
	CompressType  compress.Type
}

type Server

type Server struct {
	*rpc.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(o *Options) *Server

func (*Server) Accept

func (s *Server) Accept(lis net.Listener)

func (*Server) Register

func (s *Server) Register(rcvr interface{}) error

func (*Server) RegisterName

func (s *Server) RegisterName(name string, rcvr interface{}) error

RegisterName is like Register but uses the provided name for the type instead of the receiver's concrete type.

func (*Server) ServeCodec

func (s *Server) ServeCodec(codec rpc.ServerCodec)

func (*Server) ServeRequest

func (s *Server) ServeRequest(codec rpc.ServerCodec) error

ServeRequest is like ServeCodec but synchronously serves a single request. It does not close the codec upon completion.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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