1
Ruby Timeout, how does it even work? (flushentitypacket.github.io)
koji 積分 1 編輯於

jruby 派,測一下

jruby-1.7.18 :001 >  require 'timeout'
 => true
jruby-1.7.18 :002 > Timeout::timeout(-1) { puts '-1' }
-1
Timeout::Error: execution expired
    from org/jruby/ext/timeout/Timeout.java:128:in `timeout'
    from (irb):2:in `evaluate'
    from org/jruby/RubyKernel.java:1107:in `eval'
    from org/jruby/RubyKernel.java:1507:in `loop'
    from org/jruby/RubyKernel.java:1270:in `catch'
    from org/jruby/RubyKernel.java:1270:in `catch'
    from /Users/kojilin/.rvm/rubies/jruby-1.7.18/bin/jirb:13:in `(root)'