File: AMQPTimeoutException.php

package info (click to toggle)
php-amqplib 3.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,060 kB
  • sloc: php: 13,145; makefile: 77; sh: 27
file content (35 lines) | stat: -rw-r--r-- 785 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

namespace PhpAmqpLib\Exception;

class AMQPTimeoutException extends \RuntimeException implements AMQPExceptionInterface
{
    /**
     * @var int|float|null
     */
    private $timeout;

    public function __construct($message = '', $timeout = 0, $code = 0, ?\Exception $previous = null)
    {
        parent::__construct($message, $code, $previous);
        $this->timeout = $timeout;
    }

    /**
     * @param int|float|null $timeout
     * @param int $code
     * @return self
     */
    public static function writeTimeout($timeout, $code = 0)
    {
        return new self('Error sending data. Connection timed out.', $timeout, $code);
    }

    /**
     * @return int|float|null
     */
    public function getTimeout()
    {
        return $this->timeout;
    }
}