Spec-Zone.ru › Ruby 2.7

класс Timeout::Error

Родитель:
RuntimeError

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

Атрибуты

thread[R]

Публичные методы класса

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

Публичные методы экземпляра

exception(*) Показать исходный код
# File lib/timeout.rb, line 36
def exception(*)
  # TODO: use Fiber.current to see if self can be thrown
  if self.thread == Thread.current
    bt = caller
    begin
      throw(self, bt)
    rescue UncaughtThrowError
    end
  end
  self
end

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

Spec-Zone.ru

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