1 | <?php |
||
18 | class LoadBalancer implements LoadBalancerInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var array|HostInterface[] |
||
22 | */ |
||
23 | protected $hosts; |
||
24 | |||
25 | /** |
||
26 | * @var ChooserInterface |
||
27 | */ |
||
28 | protected $chooser; |
||
29 | |||
30 | /** |
||
31 | * @param array|HostInterface[] $hosts |
||
32 | * @param ChooserInterface $chooser |
||
33 | */ |
||
34 | public function __construct(array $hosts, ChooserInterface $chooser) |
||
42 | |||
43 | /** |
||
44 | * @param HostInterface $host |
||
45 | */ |
||
46 | public function addHost(HostInterface $host) |
||
54 | |||
55 | /** |
||
56 | * @param string $id |
||
57 | * @param string $url |
||
58 | * @param array $settings |
||
59 | */ |
||
60 | public function addHostByConfiguration($id, $url, $settings) |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | public function handleRequest(Request $request) |
||
92 | } |
||
93 |