@@ -45,15 +45,15 @@ module Concurrent
4545 #
4646 # @example Basic usage
4747 # task = Concurrent::TimerTask.new{ puts 'Boom!' }
48- # task.run!
48+ # task.execute
4949 #
5050 # task.execution_interval #=> 60 (default)
5151 # task.timeout_interval #=> 30 (default)
5252 #
5353 # # wait 60 seconds...
5454 # #=> 'Boom!'
5555 #
56- # task.stop #=> true
56+ # task.shutdown #=> true
5757 #
5858 # @example Configuring `:execution_interval` and `:timeout_interval`
5959 # task = Concurrent::TimerTask.new(execution_interval: 5, timeout_interval: 5) do
@@ -65,7 +65,7 @@ module Concurrent
6565 #
6666 # @example Immediate execution with `:run_now`
6767 # task = Concurrent::TimerTask.new(run_now: true){ puts 'Boom!' }
68- # task.run!
68+ # task.execute
6969 #
7070 # #=> 'Boom!'
7171 #
@@ -75,7 +75,7 @@ module Concurrent
7575 # execution_interval: 5
7676 # ){ Time.now }
7777 #
78- # task.run!
78+ # task.execute
7979 # Time.now #=> 2013-11-07 18:06:50 -0500
8080 # sleep(10)
8181 # task.value #=> 2013-11-07 18:06:55 -0500
@@ -87,11 +87,11 @@ module Concurrent
8787 # task.execution_interval += 1
8888 # if task.execution_interval > 5
8989 # puts 'Stopping...'
90- # task.stop
90+ # task.shutdown
9191 # end
9292 # end
9393 #
94- # timer_task.run # blocking call - this task will stop itself
94+ # timer_task.execute # blocking call - this task will stop itself
9595 # #=> Boom!
9696 # #=> Boom! Boom!
9797 # #=> Boom! Boom! Boom!
@@ -114,30 +114,30 @@ module Concurrent
114114 #
115115 # task = Concurrent::TimerTask.new(execution_interval: 1, timeout_interval: 1){ 42 }
116116 # task.add_observer(TaskObserver.new)
117- # task.run!
117+ # task.execute
118118 #
119119 # #=> (2013-10-13 19:08:58 -0400) Execution successfully returned 42
120120 # #=> (2013-10-13 19:08:59 -0400) Execution successfully returned 42
121121 # #=> (2013-10-13 19:09:00 -0400) Execution successfully returned 42
122- # task.stop
122+ # task.shutdown
123123 #
124124 # task = Concurrent::TimerTask.new(execution_interval: 1, timeout_interval: 1){ sleep }
125125 # task.add_observer(TaskObserver.new)
126- # task.run!
126+ # task.execute
127127 #
128128 # #=> (2013-10-13 19:07:25 -0400) Execution timed out
129129 # #=> (2013-10-13 19:07:27 -0400) Execution timed out
130130 # #=> (2013-10-13 19:07:29 -0400) Execution timed out
131- # task.stop
131+ # task.shutdown
132132 #
133133 # task = Concurrent::TimerTask.new(execution_interval: 1){ raise StandardError }
134134 # task.add_observer(TaskObserver.new)
135- # task.run!
135+ # task.execute
136136 #
137137 # #=> (2013-10-13 19:09:37 -0400) Execution failed with error StandardError
138138 # #=> (2013-10-13 19:09:38 -0400) Execution failed with error StandardError
139139 # #=> (2013-10-13 19:09:39 -0400) Execution failed with error StandardError
140- # task.stop
140+ # task.shutdown
141141 #
142142 # @see http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html
143143 # @see http://docs.oracle.com/javase/7/docs/api/java/util/TimerTask.html
@@ -316,7 +316,7 @@ def schedule_next_task(interval = execution_interval)
316316 # @!visibility private
317317 def execute_task ( completion )
318318 return unless @running . true?
319- Concurrent ::timer ( timeout_interval , completion , &method ( :timeout_task ) )
319+ Concurrent ::timer ( execution_interval , completion , &method ( :timeout_task ) )
320320 success , value , reason = @executor . execute ( self )
321321 if completion . try?
322322 self . value = value
0 commit comments