From 45ebff872d23976367b1a4213fee4ec52b64a09e Mon Sep 17 00:00:00 2001 From: "Ben Sheldon [he/him]" Date: Wed, 24 May 2023 16:39:23 -0700 Subject: [PATCH] Fix TimerTask docs to not refer to `#execute` as "blocking" Also fixes some small other oddities I found when running the code example --- lib/concurrent-ruby/concurrent/timer_task.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/concurrent-ruby/concurrent/timer_task.rb b/lib/concurrent-ruby/concurrent/timer_task.rb index 1274482b9..d61878139 100644 --- a/lib/concurrent-ruby/concurrent/timer_task.rb +++ b/lib/concurrent-ruby/concurrent/timer_task.rb @@ -87,7 +87,7 @@ module Concurrent # # @example Controlling execution from within the block # timer_task = Concurrent::TimerTask.new(execution_interval: 1) do |task| - # task.execution_interval.times{ print 'Boom! ' } + # task.execution_interval.to_i.times{ print 'Boom! ' } # print "\n" # task.execution_interval += 1 # if task.execution_interval > 5 @@ -96,12 +96,11 @@ module Concurrent # end # end # - # timer_task.execute # blocking call - this task will stop itself + # timer_task.execute # #=> Boom! # #=> Boom! Boom! # #=> Boom! Boom! Boom! # #=> Boom! Boom! Boom! Boom! - # #=> Boom! Boom! Boom! Boom! Boom! # #=> Stopping... # # @example Observation