Ruby 2.4参考手册
时间耗尽 | Timeout
Timeout::Error
父类:RuntimeError
当超时超时时,超时发生。
属性
threadR
公共类方法
catch(* args){| exc | ...}显示源文件
# File lib/timeout.rb, line 29
def self.catch(*args)
exc = new(*args)
exc.instance_variable_set(:@thread, Thread.current)
::Kernel.catch(exc) {yield exc}
end
公共实例方法
例外(*)显示源
# File lib/timeout.rb, line 35
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
时间耗尽 | Timeout相关
Ruby 是一种面向对象、命令式、函数式、动态的通用编程语言,是世界上最优美而巧妙的语言。
主页 | https://www.ruby-lang.org/ |
源码 | https://github.com/ruby/ruby |
版本 | 2.4 |
发布版本 | 2.4.1 |