File tree Expand file tree Collapse file tree 4 files changed +8
-10
lines changed
Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ module Concurrent
2020 # @see http://ruby-doc.org/stdlib-2.2.0/libdoc/timeout/rdoc/Timeout.html Ruby Timeout::timeout
2121 #
2222 # @!macro monotonic_clock_warning
23+ #
24+ # @deprecated timeout is deprecated and will be removed
2325 def timeout ( seconds , &block )
2426 warn '[DEPRECATED] timeout is deprecated and will be removed'
2527
Original file line number Diff line number Diff line change 11require 'concurrent/configuration'
2- require 'thread'
32
43module Concurrent
54
6- # Perform the given operation asynchronously after the given number of seconds.
7- #
8- # This is a convenience method for posting tasks to the global timer set.
9- # It is intended to be simple and easy to use. For greater control use
10- # either `TimerSet` or `ScheduledTask` directly.
5+ # [DEPRECATED] Perform the given operation asynchronously after
6+ # the given number of seconds.
117 #
128 # @param [Fixnum] seconds the interval in seconds to wait before executing the task
139 #
@@ -16,10 +12,10 @@ module Concurrent
1612 # @return [Concurrent::ScheduledTask] IVar representing the task
1713 #
1814 # @see Concurrent::ScheduledTask
19- # @see Concurrent::TimerSet
2015 #
21- # @!macro monotonic_clock_warning
16+ # @deprecated use `ScheduledTask` instead
2217 def timer ( seconds , *args , &block )
18+ warn '[DEPRECATED] use ScheduledTask instead'
2319 raise ArgumentError . new ( 'no block given' ) unless block_given?
2420 raise ArgumentError . new ( 'interval must be greater than or equal to zero' ) if seconds < 0
2521 Concurrent . configuration . global_timer_set . post ( seconds , *args , &block )
Original file line number Diff line number Diff line change 11module Concurrent
22
3- describe '#timeout' do
3+ describe '#timeout' , notravis : true do
44
55 it 'raises an exception if no block is given' do
66 expect { Concurrent ::timeout ( 0.1 ) } . to raise_error
Original file line number Diff line number Diff line change 11module Concurrent
22
3- describe '#timer' do
3+ describe '#timer' , notravis : true do
44
55 it 'raises an exception when no block given' do
66 expect {
You can’t perform that action at this time.
0 commit comments