1 | <?php |
||
31 | class Client extends Component |
||
32 | { |
||
33 | /** |
||
34 | * @var string RabbitMQ server hostname or IP address. Defaults to `localhost`. |
||
35 | */ |
||
36 | public $host = 'localhost'; |
||
37 | /** |
||
38 | * @var integer TCP-Port where RabbitMQ is listening. Defaults to `5672`. |
||
39 | */ |
||
40 | public $port = 5672; |
||
41 | /** |
||
42 | * @var string RabbitMQ server username on connect. Defaults to `guest`. |
||
43 | */ |
||
44 | public $username = 'guest'; |
||
45 | /** |
||
46 | * @var string RabbitMQ server password on connect. Defaults to `guest`. |
||
47 | */ |
||
48 | public $password = ''; |
||
49 | /** |
||
50 | * @var string RabbitMQ server virtual host to use. Defaults to `/`. |
||
51 | */ |
||
52 | public $vhost = '/'; |
||
53 | /** |
||
54 | * @var array |
||
55 | */ |
||
56 | public $options = []; |
||
57 | /** |
||
58 | * @var Connection|array|string The Connection object or the application component ID of the Connection object. |
||
59 | * It´s also possible to set an array with class and addition configuration - in that case a new objects gets generated an configured. |
||
60 | */ |
||
61 | public $connectionClass; |
||
62 | /** |
||
63 | * @var array|string The Channel class name or an array with class and addition configuration - in that case a new objects gets generated an configured. |
||
64 | */ |
||
65 | public $channelClass; |
||
66 | |||
67 | /** |
||
68 | * @var Connection |
||
69 | */ |
||
70 | protected $connection; |
||
71 | |||
72 | /** |
||
73 | * @var Container DI container holding connection (singleton) and all generated channels |
||
74 | */ |
||
75 | protected $container; |
||
76 | |||
77 | /** |
||
78 | * @inheritdoc |
||
79 | */ |
||
80 | public function init() |
||
108 | |||
109 | /** |
||
110 | * @return Connection |
||
111 | */ |
||
112 | public function getConnection() |
||
116 | |||
117 | /** |
||
118 | * Returns channel object. |
||
119 | * |
||
120 | * All further actions like sending and receiving can be done in the context of that channel. |
||
121 | * |
||
122 | * @param string $channel_id user defined name to identify channel |
||
123 | * @return Channel |
||
124 | */ |
||
125 | public function getChannel($channel_id = 'default') |
||
135 | |||
136 | /** |
||
137 | * Close an existing channel |
||
138 | * |
||
139 | * @param string $channel_id user given name during getChanncel() |
||
140 | */ |
||
141 | public function closeChannel($channel_id = 'default') |
||
150 | |||
151 | |||
152 | |||
153 | } |
||
154 |