Documentation
¶
Overview ¶
Package balancer defines APIs for load balancing in RSocket.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Balancer ¶
type Balancer interface {
io.Closer
// Put puts a new client.
Put(client rsocket.Client)
// PutLabel puts a new client with a label.
PutLabel(label string, client rsocket.Client)
// Next returns next balanced RSocket client.
Next() rsocket.Client
// OnLeave handle events when a client exit.
OnLeave(fn func(label string))
}
Balancer manage input RSocket clients.
func NewRoundRobinBalancer ¶
func NewRoundRobinBalancer() Balancer
NewRoundRobinBalancer returns a new Round-Robin Balancer.
Click to show internal directories.
Click to hide internal directories.