rpcbase

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGoroutineControl

func NewGoroutineControl(size uint32) mqrpc.GoroutineControl

func NewRPCClient

func NewRPCClient(session app.IServerSession) (mqrpc.RPCClient, error)

func NewRPCServer

func NewRPCServer(module app.IModule) (mqrpc.RPCServer, error)

Types

type ClinetCallInfo

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

type GtControl

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

func (*GtControl) Finish

func (g *GtControl) Finish()

func (*GtControl) GetMax

func (g *GtControl) GetMax() uint32

func (*GtControl) Wait

func (g *GtControl) Wait() error

type NatsClient

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

func NewNatsClient

func NewNatsClient(session app.IServerSession) (client *NatsClient, err error)

func (*NatsClient) Call

func (c *NatsClient) Call(callInfo *mqrpc.CallInfo, callback chan *core.ResultInfo) error

* 消息请求

func (*NatsClient) CallNR

func (c *NatsClient) CallNR(callInfo *mqrpc.CallInfo) error

* 消息请求 不需要回复

func (*NatsClient) CloseFch

func (c *NatsClient) CloseFch(fch chan *core.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 *core.RPCInfo) ([]byte, error)

goroutine safe

func (*NatsClient) Unmarshal

func (c *NatsClient) Unmarshal(data []byte) (*core.RPCInfo, error)

func (*NatsClient) UnmarshalResult

func (c *NatsClient) UnmarshalResult(data []byte) (*core.ResultInfo, error)

type NatsServer

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

func NewNatsServer

func NewNatsServer(s *RPCServer) (*NatsServer, error)

func (*NatsServer) Addr

func (s *NatsServer) Addr() string

func (*NatsServer) Callback

func (s *NatsServer) Callback(callinfo *mqrpc.CallInfo) error

func (*NatsServer) MarshalResult

func (s *NatsServer) MarshalResult(resultInfo *core.ResultInfo) ([]byte, error)

goroutine safe

func (*NatsServer) Shutdown

func (s *NatsServer) Shutdown() (err error)

* 注销消息队列

func (*NatsServer) Unmarshal

func (s *NatsServer) Unmarshal(data []byte) (*core.RPCInfo, error)

type RPCClient

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

func (*RPCClient) Call

func (c *RPCClient) Call(ctx context.Context, _func string, params ...any) (any, error)

func (*RPCClient) CallArgs

func (c *RPCClient) CallArgs(ctx context.Context, _func string, argTypes []string, argDatas [][]byte) (any, error)

func (*RPCClient) CallNR

func (c *RPCClient) CallNR(ctx context.Context, _func string, params ...any) (err error)

func (*RPCClient) CallNRArgs

func (c *RPCClient) CallNRArgs(ctx context.Context, _func string, argTypes []string, argDatas [][]byte) (err error)

func (*RPCClient) Done

func (c *RPCClient) Done() (err error)

type RPCServer

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

func (*RPCServer) Addr

func (s *RPCServer) Addr() string

func (*RPCServer) Call

func (s *RPCServer) Call(callInfo *mqrpc.CallInfo) error

func (*RPCServer) Done

func (s *RPCServer) Done() (err error)

func (*RPCServer) GetExecuting

func (s *RPCServer) GetExecuting() int64

* 获取当前正在执行的goroutine 数量

func (*RPCServer) Register

func (s *RPCServer) Register(id string, f any)

you must call the function before calling Open and Go

func (*RPCServer) RegisterGO

func (s *RPCServer) RegisterGO(id string, f any)

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)

Jump to

Keyboard shortcuts

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