1 | <?php |
||
12 | class ConnectionFactory |
||
13 | { |
||
14 | /** @var \ReflectionClass */ |
||
15 | private $class; |
||
16 | |||
17 | /** @var array */ |
||
18 | private $parameters = [ |
||
19 | 'host' => 'localhost', |
||
20 | 'port' => 5672, |
||
21 | 'user' => 'guest', |
||
22 | 'password' => 'guest', |
||
23 | 'vhost' => '/', |
||
24 | 'connection_timeout' => 3, |
||
25 | 'read_write_timeout' => 3, |
||
26 | 'ssl_context' => null, |
||
27 | 'keepalive' => false, |
||
28 | 'heartbeat' => 0, |
||
29 | ]; |
||
30 | |||
31 | /** |
||
32 | * @param $class string FQCN of AMQPConnection class to instantiate. |
||
33 | * @param array $parameters |
||
34 | * |
||
35 | * @throws InvalidAMQPConnectionClassException |
||
36 | */ |
||
37 | public function __construct($class, array $parameters) |
||
53 | |||
54 | /** |
||
55 | * @return array |
||
56 | */ |
||
57 | public function getParameters() |
||
61 | |||
62 | /** |
||
63 | * @return \ReflectionClass|string |
||
64 | */ |
||
65 | public function getClass() |
||
69 | |||
70 | /** |
||
71 | * @return CmobiAMQPConnectionInterface |
||
72 | */ |
||
73 | public function createConnection() |
||
92 | } |
||
93 |