Documentation ¶
Index ¶
- Constants
- func NewRPCClient(app module.App, session module.ServerSession) (mqRPC.RPCClient, error)
- func NewRPCServer(app module.App, module module.Module) (mqRPC.RPCServer, error)
- type ClinetCallInfo
- type NatsClient
- func (c *NatsClient) Call(callInfo mqrpc.CallInfo, callback chan rpcPB.ResultInfo) error
- func (c *NatsClient) CallNR(callInfo mqrpc.CallInfo) error
- func (c *NatsClient) CloseFch(fch chan rpcPB.ResultInfo)
- func (c *NatsClient) Delete(key string) (err error)
- func (c *NatsClient) Done() (err error)
- func (c *NatsClient) Marshal(rpcInfo *rpcPB.RPCInfo) ([]byte, error)
- func (c *NatsClient) Unmarshal(data []byte) (*rpcPB.RPCInfo, error)
- func (c *NatsClient) UnmarshalResult(data []byte) (*rpcPB.ResultInfo, error)
- type NatsServer
- type RPCClient
- func (c *RPCClient) Call(ctx context.Context, rpcInvokeResult *mqRPC.ResultInvokeST) (interface{}, string)
- func (c *RPCClient) CallArgs(ctx context.Context, internalFunc string, argsType []string, args [][]byte) (r interface{}, e string)
- func (c *RPCClient) CallNR(rpcInvokeResult *mqRPC.ResultInvokeST) error
- func (c *RPCClient) CallNRArgs(ifunc string, argsType []string, args [][]byte) (err error)
- func (c *RPCClient) Done() (err error)
- type RPCServer
- func (s *RPCServer) Addr() string
- func (s *RPCServer) Call(callInfo mqRPC.CallInfo) error
- func (s *RPCServer) Done() (err error)
- func (s *RPCServer) GetExecuting() int64
- func (s *RPCServer) Register(id string, f interface{})
- func (s *RPCServer) RegisterGO(id string, f interface{})
- func (s *RPCServer) SetGoroutineControl(control mqRPC.GoroutineControl)
- func (s *RPCServer) SetListener(listener mqRPC.RPCListener)
Constants ¶
View Source
const ( ClientClose string = "client close" DeadlineExceeded string = "deadline exceeded" )
Variables ¶
This section is empty.
Functions ¶
func NewRPCClient ¶
Types ¶
type ClinetCallInfo ¶
type ClinetCallInfo struct {
// contains filtered or unexported fields
}
type NatsClient ¶
type NatsClient struct {
// contains filtered or unexported fields
}
func NewNatsClient ¶
func NewNatsClient(app module.App, session module.ServerSession) (client *NatsClient, err error)
func (*NatsClient) Call ¶
func (c *NatsClient) Call(callInfo mqrpc.CallInfo, callback chan rpcPB.ResultInfo) error
消息請求
func (*NatsClient) CloseFch ¶
func (c *NatsClient) CloseFch(fch chan rpcPB.ResultInfo)
func (*NatsClient) Delete ¶
func (c *NatsClient) Delete(key string) (err error)
func (*NatsClient) Done ¶
func (c *NatsClient) Done() (err error)
func (*NatsClient) Marshal ¶
func (c *NatsClient) Marshal(rpcInfo *rpcPB.RPCInfo) ([]byte, error)
goroutine safe
func (*NatsClient) UnmarshalResult ¶
func (c *NatsClient) UnmarshalResult(data []byte) (*rpcPB.ResultInfo, error)
保存解碼後的數據,Value可以為任意數據類型
type NatsServer ¶
type NatsServer struct {
// contains filtered or unexported fields
}
func NewNatsServer ¶
func NewNatsServer(app module.App, s *RPCServer) (*NatsServer, error)
func (*NatsServer) MarshalResult ¶
func (s *NatsServer) MarshalResult(resultInfo rpcPB.ResultInfo) ([]byte, error)
goroutine safe
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
func (*RPCClient) Call ¶
func (c *RPCClient) Call(ctx context.Context, rpcInvokeResult *mqRPC.ResultInvokeST) (interface{}, string)
* 消息请求 需要回复
func (*RPCClient) CallNR ¶
func (c *RPCClient) CallNR(rpcInvokeResult *mqRPC.ResultInvokeST) error
* 消息请求 不需要回复
func (*RPCClient) CallNRArgs ¶
type RPCServer ¶
type RPCServer struct {
// contains filtered or unexported fields
}
func (*RPCServer) RegisterGO ¶
you must call the function before calling Open and Go
func (*RPCServer) SetGoroutineControl ¶
func (s *RPCServer) SetGoroutineControl(control mqRPC.GoroutineControl)
func (*RPCServer) SetListener ¶
func (s *RPCServer) SetListener(listener mqRPC.RPCListener)
Click to show internal directories.
Click to hide internal directories.