|
4 | 4 | require 'concurrent/concern/observable' |
5 | 5 | require 'concurrent/concern/logging' |
6 | 6 | require 'concurrent/executor/executor' |
7 | | -require 'concurrent/concern/deprecation' |
8 | 7 |
|
9 | 8 | module Concurrent |
10 | 9 |
|
@@ -85,7 +84,6 @@ class Agent |
85 | 84 | include Concern::Dereferenceable |
86 | 85 | include Concern::Observable |
87 | 86 | include Concern::Logging |
88 | | - include Concern::Deprecation |
89 | 87 |
|
90 | 88 | attr_reader :timeout, :io_executor, :fast_executor |
91 | 89 |
|
@@ -179,30 +177,13 @@ def post(&block) |
179 | 177 | # Update the current value with the result of the given block fast, |
180 | 178 | # block can do blocking calls |
181 | 179 | # |
182 | | - # @param [Fixnum, nil] timeout [DEPRECATED] maximum number of seconds before an update is cancelled |
183 | | - # |
184 | 180 | # @yield the fast to be performed with the current value in order to calculate |
185 | 181 | # the new value |
186 | 182 | # @yieldparam [Object] value the current value |
187 | 183 | # @yieldreturn [Object] the new value |
188 | 184 | # @return [true, nil] nil when no block is given |
189 | | - def post_off(timeout = nil, &block) |
190 | | - task = if timeout |
191 | | - deprecated 'post_off with option timeout options is deprecated and will be removed' |
192 | | - lambda do |value| |
193 | | - future = Future.execute do |
194 | | - block.call(value) |
195 | | - end |
196 | | - if future.wait(timeout) |
197 | | - future.value! |
198 | | - else |
199 | | - raise Concurrent::TimeoutError |
200 | | - end |
201 | | - end |
202 | | - else |
203 | | - block |
204 | | - end |
205 | | - post_on(@io_executor, &task) |
| 185 | + def post_off(&block) |
| 186 | + post_on(@io_executor, &block) |
206 | 187 | end |
207 | 188 |
|
208 | 189 | # Update the current value with the result of the given block fast, |
|
0 commit comments