broker

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: MIT Imports: 5 Imported by: 0

README

broker.Pool

Idiomatic self-sustaining AMQP broker pool for Go.

License

MIT - © dtg [at] lengo [dot] org

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialer

type Dialer = func(endpoint string) (*amqp.Connection, error)

Dialer is the callback function that provides an AMQP connection.

type FairPool

type FairPool struct {
	Dialer         Dialer
	Endpoints      []url.URL
	RedialInterval time.Duration
	AcquireTimeout time.Duration

	OnBrokerOpen  func(url.URL)
	OnBrokerClose func(url.URL)
	OnBrokerError func(error)
	// contains filtered or unexported fields
}

FairPool ...

func (*FairPool) Acquire

func (p *FairPool) Acquire() *amqp.Connection

Acquire ...

func (*FairPool) Launch

func (p *FairPool) Launch()

Launch ...

func (*FairPool) Release

func (p *FairPool) Release(*amqp.Connection)

Release ...

func (*FairPool) Shutdown

func (p *FairPool) Shutdown()

Shutdown ...

type Pool

type Pool interface {
	Launch()
	Shutdown()
	Acquire() *amqp.Connection
	Release(*amqp.Connection)
}

Pool ...

func NewFairPool

func NewFairPool(endpoints []url.URL) Pool

NewFairPool ...

Jump to

Keyboard shortcuts

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