rpcutil

package
v0.1.50 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: LGPL-2.1 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDistEntityNotFound     = errors.New("rpc: distributed entity not found")
	ErrDistEntityNodeNotFound = errors.New("rpc: distributed entity node not found")
)

Functions

This section is empty.

Types

type EntityProxied

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

EntityProxied 实体代理,用于向实体发送RPC

func ProxyEntity

func ProxyEntity(ctx service.Context, id uid.Id) EntityProxied

ProxyEntity 代理实体

func (EntityProxied) BalanceOneWayRPC

func (p EntityProxied) BalanceOneWayRPC(service, comp, method string, args ...any) error

BalanceOneWayRPC 使用负载均衡模式,向分布式实体目标服务发送单向RPC

func (EntityProxied) BalanceRPC

func (p EntityProxied) BalanceRPC(service, comp, method string, args ...any) runtime.AsyncRet

BalanceRPC 使用负载均衡模式,向分布式实体目标服务发送RPC

func (EntityProxied) BroadcastOneWayRPC

func (p EntityProxied) BroadcastOneWayRPC(service, comp, method string, args ...any) error

BroadcastOneWayRPC 使用广播模式,向分布式实体目标服务发送单向RPC

func (EntityProxied) CliRPC

func (p EntityProxied) CliRPC(method string, args ...any) runtime.AsyncRet

CliRPC 向客户端发送RPC

func (EntityProxied) CliRPCToEntity

func (p EntityProxied) CliRPCToEntity(entityId uid.Id, method string, args ...any) runtime.AsyncRet

CliRPCToEntity 向客户端实体发送RPC

func (EntityProxied) GetId added in v0.1.37

func (p EntityProxied) GetId() uid.Id

GetId 获取实体id

func (EntityProxied) GlobalBalanceOneWayRPC

func (p EntityProxied) GlobalBalanceOneWayRPC(comp, method string, args ...any) error

GlobalBalanceOneWayRPC 使用全局负载均衡模式,向分布式实体任意服务发送单向RPC

func (EntityProxied) GlobalBalanceRPC

func (p EntityProxied) GlobalBalanceRPC(comp, method string, args ...any) runtime.AsyncRet

GlobalBalanceRPC 使用全局负载均衡模式,向分布式实体任意服务发送RPC

func (EntityProxied) GlobalBroadcastOneWayRPC

func (p EntityProxied) GlobalBroadcastOneWayRPC(comp, method string, args ...any) error

GlobalBroadcastOneWayRPC 使用全局广播模式,向分布式实体所有服务发送单向RPC

func (EntityProxied) OneWayCliRPC

func (p EntityProxied) OneWayCliRPC(method string, args ...any) error

OneWayCliRPC 向客户端发送单向RPC

func (EntityProxied) OneWayCliRPCToEntity

func (p EntityProxied) OneWayCliRPCToEntity(entityId uid.Id, method string, args ...any) error

OneWayCliRPCToEntity 向客户端实体发送单向RPC

func (EntityProxied) OneWayRPC

func (p EntityProxied) OneWayRPC(service, comp, method string, args ...any) error

OneWayRPC 向分布式实体目标服务发送单向RPC

func (EntityProxied) RPC

func (p EntityProxied) RPC(service, comp, method string, args ...any) runtime.AsyncRet

RPC 向分布式实体目标服务发送RPC

type GroupProxied

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

GroupProxied 分组代理,用于向分组发送RPC

func ProxyGroup

func ProxyGroup(ctx service.Context, id uid.Id) GroupProxied

ProxyGroup 代理分组

func (GroupProxied) GetId added in v0.1.37

func (p GroupProxied) GetId() uid.Id

GetId 获取分组id

func (GroupProxied) OneWayCliRPC

func (p GroupProxied) OneWayCliRPC(method string, args ...any) error

OneWayCliRPC 向分组客户端发送单向RPC

func (GroupProxied) OneWayCliRPCToEntity

func (p GroupProxied) OneWayCliRPCToEntity(entityId uid.Id, method string, args ...any) error

OneWayCliRPCToEntity 向分组客户端实体发送单向RPC

type RuntimeProxied

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

RuntimeProxied 运行时代理,用于向实体的运行时发送RPC

func ProxyRuntime

func ProxyRuntime(ctx service.Context, entityId uid.Id) RuntimeProxied

ProxyRuntime 代理运行时

func (RuntimeProxied) BalanceOneWayRPC

func (p RuntimeProxied) BalanceOneWayRPC(service, plugin, method string, args ...any) error

BalanceOneWayRPC 使用负载均衡模式,向分布式实体目标服务的运行时发送单向RPC

func (RuntimeProxied) BalanceRPC

func (p RuntimeProxied) BalanceRPC(service, plugin, method string, args ...any) runtime.AsyncRet

BalanceRPC 使用负载均衡模式,向分布式实体目标服务的运行时发送RPC

func (RuntimeProxied) BroadcastOneWayRPC

func (p RuntimeProxied) BroadcastOneWayRPC(service, plugin, method string, args ...any) error

BroadcastOneWayRPC 使用广播模式,向分布式实体目标服务的运行时发送单向RPC

func (RuntimeProxied) GetEntityId added in v0.1.37

func (p RuntimeProxied) GetEntityId() uid.Id

GetEntityId 获取实体id

func (RuntimeProxied) GlobalBalanceOneWayRPC

func (p RuntimeProxied) GlobalBalanceOneWayRPC(plugin, method string, args ...any) error

GlobalBalanceOneWayRPC 使用全局负载均衡模式,向分布式实体任意服务的运行时发送单向RPC

func (RuntimeProxied) GlobalBalanceRPC

func (p RuntimeProxied) GlobalBalanceRPC(plugin, method string, args ...any) runtime.AsyncRet

GlobalBalanceRPC 使用全局负载均衡模式,向分布式实体任意服务的运行时发送RPC

func (RuntimeProxied) GlobalBroadcastOneWayRPC

func (p RuntimeProxied) GlobalBroadcastOneWayRPC(plugin, method string, args ...any) error

GlobalBroadcastOneWayRPC 使用全局广播模式,向分布式实体所有服务的运行时发送单向RPC

func (RuntimeProxied) OneWayRPC

func (p RuntimeProxied) OneWayRPC(service, plugin, method string, args ...any) error

OneWayRPC 向分布式实体目标服务的运行时发送单向RPC

func (RuntimeProxied) RPC

func (p RuntimeProxied) RPC(service, plugin, method string, args ...any) runtime.AsyncRet

RPC 向分布式实体目标服务的运行时发送RPC

type ServiceProxied

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

ServiceProxied 实体服务,用于向服务发送RPC

func ProxyService

func ProxyService(ctx service.Context, service ...string) ServiceProxied

ProxyService 代理服务

func (ServiceProxied) BalanceOneWayRPC

func (p ServiceProxied) BalanceOneWayRPC(plugin, method string, args ...any) error

BalanceOneWayRPC 使用负载均衡模式,向分布式服务发送单向RPC

func (ServiceProxied) BalanceRPC

func (p ServiceProxied) BalanceRPC(plugin, method string, args ...any) runtime.AsyncRet

BalanceRPC 使用负载均衡模式,向分布式服务发送RPC

func (ServiceProxied) BroadcastOneWayRPC

func (p ServiceProxied) BroadcastOneWayRPC(plugin, method string, args ...any) error

BroadcastOneWayRPC 使用广播模式,向分布式服务发送单向RPC

func (ServiceProxied) GetService added in v0.1.37

func (p ServiceProxied) GetService() string

GetService 获取服务名

func (ServiceProxied) OneWayRPC

func (p ServiceProxied) OneWayRPC(nodeId uid.Id, plugin, method string, args ...any) error

OneWayRPC 向分布式服务发送单向RPC

func (ServiceProxied) RPC

func (p ServiceProxied) RPC(nodeId uid.Id, plugin, method string, args ...any) runtime.AsyncRet

RPC 向分布式服务发送RPC

Jump to

Keyboard shortcuts

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