Skip to content

warning: ambiguous Java methods found #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/concurrent/executor/executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,19 @@ def kill_execution

module JavaExecutor
include Executor
java_import 'java.lang.Runnable'

# @!macro executor_method_post
def post(*args)
raise ArgumentError.new('no block given') unless block_given?
if running?
@executor.submit{ yield(*args) }
executor_submit = @executor.java_method(:submit, [Runnable.java_class])
executor_submit.call { yield(*args) }
true
else
false
end
rescue Java::JavaUtilConcurrent::RejectedExecutionException => ex
rescue Java::JavaUtilConcurrent::RejectedExecutionException
raise RejectedExecutionError
end

Expand Down