Example #1
0
 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;
 }
Example #2
0
 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);
 }