public function __construct(IConnectionSingle $connection, $size) { $this->_connection = $connection; $this->_reader = $connection->getResponseReader(); $this->_position = 0; $this->_current = $size > 0 ? $this->getValue() : null; $this->_replySize = $size; }
public function add(IConnectionSingle $connection) { $parameters = $connection->getParameters(); if (isset($parameters->alias)) { $this->_pool[$parameters->alias] = $connection; } else { $this->_pool[] = $connection; } $this->_distributor->add($connection, $parameters->weight); }