server

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 19 Imported by: 12 modules, 11 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandler

func RegisterHandler[RequestType proto.Message, ResponseType proto.Message](
	s *RPCServer,
	rpc string,
	topic []string,
	svcImpl func(context.Context, RequestType) (ResponseType, error),
	affinityFunc AffinityFunc[RequestType],
) error

func RegisterStreamHandler

func RegisterStreamHandler[RequestType proto.Message, ResponseType proto.Message](
	s *RPCServer,
	rpc string,
	topic []string,
	svcImpl func(psrpc.ServerStream[ResponseType, RequestType]) error,
	affinityFunc StreamAffinityFunc,
) error

Types

type AffinityFunc

type AffinityFunc[RequestType proto.Message] func(context.Context, RequestType) float32

type RPCServer

type RPCServer struct {
	*info.ServiceDefinition
	psrpc.ServerOpts
	// contains filtered or unexported fields
}

func NewRPCServer

func NewRPCServer(sd *info.ServiceDefinition, b bus.MessageBus, opts ...psrpc.ServerOption) *RPCServer

func (*RPCServer) Close

func (s *RPCServer) Close(force bool)

func (*RPCServer) DeregisterHandler

func (s *RPCServer) DeregisterHandler(rpc string, topic []string)

func (*RPCServer) Publish

func (s *RPCServer) Publish(ctx context.Context, rpc string, topic []string, msg proto.Message) error

type Registerer

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

func NewRegisterer

func NewRegisterer(register, deregister any) Registerer

type RegistererSlice

type RegistererSlice []Registerer

func (RegistererSlice) Deregister

func (rs RegistererSlice) Deregister(params ...any)

func (RegistererSlice) Register

func (rs RegistererSlice) Register(params ...any) error

type StreamAffinityFunc

type StreamAffinityFunc func(ctx context.Context) float32

Jump to

Keyboard shortcuts

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