Skip to content

Commit 08cb086

Browse files
author
Maxim Chechel
committed
1 parent f4ea4f0 commit 08cb086

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/concurrent/executor/executor.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,13 @@ module JavaExecutor
213213
def post(*args)
214214
raise ArgumentError.new('no block given') unless block_given?
215215
if running?
216-
@executor.submit{ yield(*args) }
216+
executor_submit = @executor.java_method(:submit, [JavaConcurrent::Runnable.java_class])
217+
executor_submit.call { yield(*args) }
217218
true
218219
else
219220
false
220221
end
221-
rescue Java::JavaUtilConcurrent::RejectedExecutionException => ex
222+
rescue Java::JavaUtilConcurrent::RejectedExecutionException
222223
raise RejectedExecutionError
223224
end
224225

0 commit comments

Comments
 (0)