rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.66k stars 193 forks source link

There is no way to set a timeout for a script #279

Closed SamSaffron closed 10 years ago

SamSaffron commented 10 years ago

The following will never die.

require 'v8'
require 'timeout'

puts "here"

t = Thread.current

Thread.new do
  sleep 5
  t.kill
end

Timeout::timeout(5) do
  V8::Context.new do |ctx|
    ctx.eval("while(true){}")
  end
end

puts "done"
cowboyd commented 10 years ago

closed by #280