rpc

package
v0.0.0-...-e50a933 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2017 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// MaxCallLimit 最大调用限制,如果超过就会有阻塞
	MaxCallLimit = 10000
)

Variables

View Source
var DefaultRPC = new(RPC)

DefaultRPC 默认rpc接口实例

Functions

This section is empty.

Types

type KRPCError

type KRPCError struct {
	// contains filtered or unexported fields
}

KRPCError 错误描述

func (*KRPCError) Error

func (err *KRPCError) Error() string

type RPC

type RPC struct {
	// contains filtered or unexported fields
}

RPC 结构,用户处理内部RPC任务

func (*RPC) Call

func (r *RPC) Call(key interface{}, args ...interface{})

Call rpc调用接口,需要传入回调接口,接口格式 func (error,args ...interface{})

func (*RPC) Exit

func (r *RPC) Exit(err error)

Exit RPC退出处理函数

func (*RPC) Init

func (r *RPC) Init()

Init 初始化接口

func (*RPC) Notify

func (r *RPC) Notify(key interface{}, args ...interface{})

Notify rpc通知类型接口,不需要传入回调

func (*RPC) Register

func (r *RPC) Register(key interface{}, f interface{})

Register rpc注册接口

func (*RPC) Run

func (r *RPC) Run() error

Run 运行函数

func (*RPC) SetLogger

func (r *RPC) SetLogger(log logger)

SetLogger 设置日志实例接口,接口必须实现 Info,Debug,Warn,Error接口

func (*RPC) Stop

func (r *RPC) Stop()

Stop 停止rpc服务 运行

Jump to

Keyboard shortcuts

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