| 1 | <?php |
||
| 4 | class AMQPLazyConnection extends AMQPStreamConnection |
||
| 5 | { |
||
| 6 | /** |
||
| 7 | * Gets socket from current connection |
||
| 8 | * |
||
| 9 | * @deprecated |
||
| 10 | */ |
||
| 11 | public function getSocket() |
||
| 12 | { |
||
| 13 | $this->connect(); |
||
| 14 | |||
| 15 | return parent::getSocket(); |
||
| 16 | } |
||
| 17 | |||
| 18 | /** |
||
| 19 | * {@inheritdoc} |
||
| 20 | */ |
||
| 21 | 10 | public function channel($channel_id = null) |
|
| 22 | { |
||
| 23 | 10 | $this->connect(); |
|
| 24 | |||
| 25 | 10 | return parent::channel($channel_id); |
|
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @return null|\PhpAmqpLib\Wire\IO\AbstractIO |
||
| 30 | */ |
||
| 31 | 10 | protected function getIO() |
|
| 32 | { |
||
| 33 | 10 | if (!$this->io) { |
|
| 34 | $this->connect(); |
||
| 35 | } |
||
| 36 | |||
| 37 | 10 | return $this->io; |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Should the connection be attempted during construction? |
||
| 42 | * |
||
| 43 | * @return bool |
||
| 44 | */ |
||
| 45 | 10 | public function connectOnConstruct() |
|
| 49 | } |
||
| 50 |