Skip to content

Commit 1da7c0e

Browse files
committed
Merge pull request #344 from ruby-concurrency/fix/timer-task
Fixes erroneous deprecation warning in TimerTask.
2 parents b2c5bae + 7de2d01 commit 1da7c0e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/concurrent/configuration.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ def self.global_immediate_executor
131131
# Global thread pool user for global *timers*.
132132
#
133133
# @return [Concurrent::TimerSet] the thread pool
134-
#
135-
# @see Concurrent::timer
136134
def self.global_timer_set
137135
GLOBAL_TIMER_SET.value
138136
end

lib/concurrent/timer_task.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,14 @@ def kill_execution
297297

298298
# @!visibility private
299299
def schedule_next_task(interval = execution_interval)
300-
Concurrent::timer(interval, Concurrent::Event.new, &method(:execute_task))
300+
ScheduledTask.execute(interval, args: [Concurrent::Event.new], &method(:execute_task))
301+
nil
301302
end
302303

303304
# @!visibility private
304305
def execute_task(completion)
305-
return unless @running.true?
306-
Concurrent::timer(execution_interval, completion, &method(:timeout_task))
306+
return nil unless @running.true?
307+
ScheduledTask.execute(execution_interval, args: [completion], &method(:timeout_task))
307308
_success, value, reason = @executor.execute(self)
308309
if completion.try?
309310
self.value = value
@@ -313,6 +314,7 @@ def execute_task(completion)
313314
[time, self.value, reason]
314315
end
315316
end
317+
nil
316318
end
317319

318320
# @!visibility private

0 commit comments

Comments
 (0)