connectionpool

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

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

Container contains connection and related info

type IConnectionProvider

type IConnectionProvider interface {
	NewConnection(string, string, string, *gologger.CustomLogger) (*amqp.Connection, error)
}

IConnectionProvider defines the interface to be implemented by a connection provider.

type Pool

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

Pool represents a pool of connections

func NewConnectionPool

func NewConnectionPool(serverList *[]string, username string, password string, connectionProvider IConnectionProvider, logger *gologger.CustomLogger) *Pool

NewConnectionPool returns new connection pool, waits for 3 seconds before returning

func (*Pool) GetConnection

func (pool *Pool) GetConnection() (*amqp.Connection, error)

GetConnection provides a rabbitmq connection from connection pool, times out in 1 minute if unable to get a connection

Jump to

Keyboard shortcuts

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