Skip to content

Fixes erroneous deprecation warning in TimerTask. #344

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 1 commit into from
Jun 12, 2015
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions lib/concurrent/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ def self.global_immediate_executor
# Global thread pool user for global *timers*.
#
# @return [Concurrent::TimerSet] the thread pool
#
# @see Concurrent::timer
def self.global_timer_set
GLOBAL_TIMER_SET.value
end
Expand Down
8 changes: 5 additions & 3 deletions lib/concurrent/timer_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,14 @@ def kill_execution

# @!visibility private
def schedule_next_task(interval = execution_interval)
Concurrent::timer(interval, Concurrent::Event.new, &method(:execute_task))
ScheduledTask.execute(interval, args: [Concurrent::Event.new], &method(:execute_task))
nil
end

# @!visibility private
def execute_task(completion)
return unless @running.true?
Concurrent::timer(execution_interval, completion, &method(:timeout_task))
return nil unless @running.true?
ScheduledTask.execute(execution_interval, args: [completion], &method(:timeout_task))
_success, value, reason = @executor.execute(self)
if completion.try?
self.value = value
Expand All @@ -313,6 +314,7 @@ def execute_task(completion)
[time, self.value, reason]
end
end
nil
end

# @!visibility private
Expand Down