PHP Class Thumper\ConnectionRegistry

Datei anzeigen Open project: php-amqplib/thumper

Protected Properties

Property Type Description
$connections PhpAmqpLib\Connection\AbstractConnection[]
$defaultConnection string

Public Methods

Method Description
__construct ( array $connections, string $defaultConnection ) ConnectionRegistry constructor.
addConnection ( string $name, PhpAmqpLib\Connection\AbstractConnection $connection ) Add connection to connections registry.
getConnection ( string $name = null ) : PhpAmqpLib\Connection\AbstractConnection Return a connection.

Method Details

__construct() public method

ConnectionRegistry constructor.
public __construct ( array $connections, string $defaultConnection )
$connections array Array of connections.
$defaultConnection string Key of default connection.

addConnection() public method

Add connection to connections registry.
public addConnection ( string $name, PhpAmqpLib\Connection\AbstractConnection $connection )
$name string Key for connection.
$connection PhpAmqpLib\Connection\AbstractConnection Connection object.

getConnection() public method

Return a connection.
public getConnection ( string $name = null ) : PhpAmqpLib\Connection\AbstractConnection
$name string Key of connection to get.
return PhpAmqpLib\Connection\AbstractConnection

Property Details

$connections protected_oe property

protected AbstractConnection[],PhpAmqpLib\Connection $connections
return PhpAmqpLib\Connection\AbstractConnection[]

$defaultConnection protected_oe property

protected string $defaultConnection
return string