PHP Class Mongolid\Connection\Pool

Show file Open project: leroy-merlin-br/mongolid Class Usage Examples

Protected Properties

Property Type Description
$connections SplQueue Opened connections.

Public Methods

Method Description
__construct ( ) Constructs a connection pool.
addConnection ( Connection $conn ) : boolean Adds a new connection to the pool.
getConnection ( ) : Connection Gets a connection from the pool. It will cycle through the existent connections.

Method Details

__construct() public method

Constructs a connection pool.
public __construct ( )

addConnection() public method

Adds a new connection to the pool.
public addConnection ( Connection $conn ) : boolean
$conn Connection The actual connection that will be added to the pool.
return boolean Success

getConnection() public method

Gets a connection from the pool. It will cycle through the existent connections.
public getConnection ( ) : Connection
return Connection

Property Details

$connections protected property

Opened connections.
protected SplQueue $connections
return SplQueue