chain

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouterChain

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

RouterChain Router chain

func NewRouterChain

func NewRouterChain() (*RouterChain, error)

NewRouterChain init router chain Loop routerFactories and call NewRouter method

func (*RouterChain) AddRouters

func (c *RouterChain) AddRouters(routers []router.PriorityRouter)

AddRouters Add routers to router chain New a array add builtinRouters which is not sorted in RouterChain and routers Sort the array Replace router array in RouterChain

func (*RouterChain) Route

func (c *RouterChain) Route(url *common.URL, invocation protocol.Invocation) []protocol.Invoker

Route Loop routers in RouterChain and call Route method to determine the target invokers list.

func (*RouterChain) SetInvokers

func (c *RouterChain) SetInvokers(invokers []protocol.Invoker)

SetInvokers receives updated invokers from registry center. If the times of notification exceeds countThreshold and time interval exceeds timeThreshold since last cache update, then notify to update the cache.

Jump to

Keyboard shortcuts

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