runtime

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorSelectorMismatch = fmt.Errorf("selector mismatch")
)

Functions

func HandleClientRequestResponse

func HandleClientRequestResponse(ctx context.Context, selector uint64, methodName string, req proto.Message, handler ClientRequestResponseHandler) ([]byte, error)

func HandleClientRequestResponseAsync

func HandleClientRequestResponseAsync(ctx context.Context, selector uint64, methodName string, req proto.Message, handler ClientRequestResponseHandlerAsync) *mo.Future[[]byte]

func RSocketServerRequestResponseHandler

func RSocketServerRequestResponseHandler(servers *Servers) func(payload.Payload) mono.Mono

Types

type ClientRequestResponseHandler

type ClientRequestResponseHandler func(context.Context, []byte) ([]byte, error)

func RSocketClientRequestResponseHandler

func RSocketClientRequestResponseHandler(rs rsocket.RSocket) ClientRequestResponseHandler

type ClientRequestResponseHandlerAsync

type ClientRequestResponseHandlerAsync func(context.Context, []byte) *mo.Future[[]byte]

func RSocketClientRequestResponseHandlerAsync

func RSocketClientRequestResponseHandlerAsync(rs rsocket.RSocket) ClientRequestResponseHandlerAsync

type RequestWrapper

type RequestWrapper struct {
	Selector   uint64
	MethodName string
	Payload    []byte
}

func (*RequestWrapper) Marshal

func (reqWrapper *RequestWrapper) Marshal(w io.Writer) error

func (*RequestWrapper) Unmarshal

func (reqWrapper *RequestWrapper) Unmarshal(r io.Reader) error

type Server

type Server interface {
	Selector() uint64
	HandleRequestResponse(context.Context, *RequestWrapper) (proto.Message, error)
}

type ServerRequestResponseHandler

type ServerRequestResponseHandler func(context.Context, *RequestWrapper) (proto.Message, error)

type ServerRequestResponseHandlerAsync

type ServerRequestResponseHandlerAsync func(context.Context, *RequestWrapper) *mo.Future[proto.Message]

type Servers

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

func NewServers

func NewServers(servers ...Server) *Servers

func (*Servers) AddServer added in v0.2.0

func (servers *Servers) AddServer(server Server)

func (*Servers) HandleRequestResponse

func (servers *Servers) HandleRequestResponse(ctx context.Context, reqWrapperBytes []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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