balancer

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

type Balancer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(producerNetwork string, producerAddress string,
	consumerNetwork string, consumerAddress string) *Balancer

New Balancer service.

func (*Balancer) Start

func (b *Balancer) Start()

Start the balancer Service and wait for clients.

type ConsumerHandler

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

func NewConsumerHandler

func NewConsumerHandler(balancer *Balancer, events chan<- Event, quit <-chan struct{}) *ConsumerHandler

type ConsumerWorker

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

func (*ConsumerWorker) Start

func (w *ConsumerWorker) Start()

type Event

type Event int
const (
	ProducerListenerReady Event = iota
	NewProducer
	ProducerClose
	LastProducerClose

	ConsumerListenerReady
	NewConsumer
	ConsumerClose
	LastConsumerClose
)

type Handler

type Handler interface {
	// contains filtered or unexported methods
}

type Listener

type Listener struct {
	Handler
	// contains filtered or unexported fields
}

func NewListenerFactory

func NewListenerFactory(handler Handler, network string, address string, readyCallback func()) *Listener

func (Listener) Start

func (l Listener) Start()

type ProducerHandler

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

func NewProducerHandler

func NewProducerHandler(balancer *Balancer, events chan<- Event, quit <-chan struct{}) *ProducerHandler

type ProducerWorker

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

func (*ProducerWorker) Start

func (w *ProducerWorker) Start()

type State

type State int
const (
	Initial State = iota
	ProducerReady
	ConsumerReady
	NoConsumerAndNoProducer
	ConsumerAwaiting
	ProducerAwaiting
	ConsumerAndProcuder
	ConsumerCloseFirst
	ProducerCloseFirst
)

type StateEvent

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

Jump to

Keyboard shortcuts

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