RoundRobin.php 461 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Elastica\Connection\Strategy;
  3. /**
  4. * Description of RoundRobin.
  5. *
  6. * @author chabior
  7. */
  8. class RoundRobin extends Simple
  9. {
  10. /**
  11. * @param array|\Elastica\Connection[] $connections
  12. *
  13. * @throws \Elastica\Exception\ClientException
  14. *
  15. * @return \Elastica\Connection
  16. */
  17. public function getConnection($connections)
  18. {
  19. shuffle($connections);
  20. return parent::getConnection($connections);
  21. }
  22. }