【发布时间】:2014-01-11 03:06:36
【问题描述】:
我需要我的 JRuby 方法来接收 Java 方法中发生的事情的报告并采取相应的行动:
def my_long_running_method
# ... do stuff ...
jObject.count_all_disk_files do |number_of_files|
stream.write "#{number_of_files} files found so far."
end
# ... do more stuff ...
end
我看到了this question,但我不明白我需要做什么。
我已经了解 Ruby 很长时间了,还对 Java 有一点了解。这个项目需要 JRuby,因为旧的 Java 代码需要与新的 Ruby 代码集成。
【问题讨论】:
标签: java ruby-on-rails ruby jruby block