public function setTimeout($timeout = null)
    {
        if ($timeout === null) {
            $timeout = 30000;
        }
        if (!is_int($timeout)) {
            throw new \InvalidArgumentException('Parameter is not an integer');
        }
        if ($timeout < 0) {
            throw new \InvalidArgumentException(
                'Parameter is negative. Only positive timeouts accepted.'
            );
        }

        $this->timeout = $timeout;

        return $this;
    }