remote

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClusterDispatcher

func NewClusterDispatcher(client ClusterClient, conn *grpc.ClientConn, config ClusterDispatcherConfig, secondaryDispatch map[string]SecondaryDispatch, secondaryDispatchExprs map[string]*DispatchExpr) dispatch.Dispatcher

NewClusterDispatcher creates a dispatcher implementation that uses the provided client to dispatch requests to peer nodes in the cluster.

func RunDispatchExpr added in v1.27.0

func RunDispatchExpr[R any](de *DispatchExpr, request R) ([]string, error)

RunDispatchExpr runs a dispatch CEL expression over the given request and returns the secondary dispatchers to invoke, if any.

Types

type ClusterDispatcherConfig added in v1.16.2

type ClusterDispatcherConfig struct {
	// KeyHandler is then handler to use for generating dispatch hash ring keys.
	KeyHandler keys.Handler

	// DispatchOverallTimeout is the maximum duration of a dispatched request
	// before it should timeout.
	DispatchOverallTimeout time.Duration
}

type DispatchExpr added in v1.27.0

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

DispatchExpr is a CEL expression that can be run to determine the secondary dispatchers, if any, to invoke for the incoming request.

func ParseDispatchExpression added in v1.27.0

func ParseDispatchExpression(methodName string, exprString string) (*DispatchExpr, error)

ParseDispatchExpression parses a dispatch expression via CEL.

type SecondaryDispatch added in v1.27.0

type SecondaryDispatch struct {
	Name   string
	Client ClusterClient
}

SecondaryDispatch defines a struct holding a client and its name for secondary dispatching.

Jump to

Keyboard shortcuts

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