Wrap text
Report abuse
1
2
3
4
5
6
7
8
9
10
11
12
13
|
require 'java'
task = java.util.concurrent.FutureTask.new { "HEH" }
es = java.util.concurrent.Executors.newSingleThreadExecutor
es.submit task
begin
result = task.get
puts "Result from task.get () = " + result
rescue
puts $!
end
es.shutdown
|