We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4ea4f0 commit 08cb086Copy full SHA for 08cb086
lib/concurrent/executor/executor.rb
@@ -213,12 +213,13 @@ module JavaExecutor
213
def post(*args)
214
raise ArgumentError.new('no block given') unless block_given?
215
if running?
216
- @executor.submit{ yield(*args) }
+ executor_submit = @executor.java_method(:submit, [JavaConcurrent::Runnable.java_class])
217
+ executor_submit.call { yield(*args) }
218
true
219
else
220
false
221
end
- rescue Java::JavaUtilConcurrent::RejectedExecutionException => ex
222
+ rescue Java::JavaUtilConcurrent::RejectedExecutionException
223
raise RejectedExecutionError
224
225
0 commit comments