Spec-Zone.ru › Ruby 3.1

класс Timeout::Error

Родитель:
RuntimeError

Вызывается Timeout.timeout, когда блок ожидания истекает.

Атрибуты

thread[R]

Общедоступные методы класса

catch(*args) { |exc| ... } Показать исходный код
# File lib/timeout.rb, line 32
def self.catch(*args)
  exc = new(*args)
  exc.instance_variable_set(:@thread, Thread.current)
  exc.instance_variable_set(:@catch_value, exc)
  ::Kernel.catch(exc) {yield exc}
end

Общедоступные методы экземпляра

exception(*) Показать исходный код
# File lib/timeout.rb, line 39
def exception(*)
  # TODO: use Fiber.current to see if self can be thrown
  if self.thread == Thread.current
    bt = caller
    begin
      throw(@catch_value, bt)
    rescue UncaughtThrowError
    end
  end
  super
end
Вызывает метод суперкласса Exception::exception

Ruby Core © 1993–2022 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API