|
4 | 4 | require 'concurrent/executor/executor' |
5 | 5 | require 'concurrent/executor/safe_task_executor' |
6 | 6 |
|
7 | | -# deprecated Updated to use `Executor` instead of `Runnable` |
8 | | -require 'concurrent/runnable' |
9 | | - |
10 | 7 | module Concurrent |
11 | 8 |
|
12 | 9 | # A very common currency pattern is to run a thread that performs a task at regular |
@@ -295,32 +292,6 @@ def timeout_interval=(value) |
295 | 292 | end |
296 | 293 | end |
297 | 294 |
|
298 | | - # @deprecated Updated to use `Executor` instead of `Runnable` |
299 | | - def terminate(*args) deprecated(:terminate, :kill, *args); end |
300 | | - |
301 | | - # @deprecated Updated to use `Executor` instead of `Runnable` |
302 | | - def stop(*args) deprecated(:stop, :shutdown, *args); end |
303 | | - |
304 | | - # @deprecated Updated to use `Executor` instead of `Runnable` |
305 | | - def cancel(*args) deprecated(:cancel, :shutdown, *args); end |
306 | | - |
307 | | - # @deprecated Updated to use `Executor` instead of `Runnable` |
308 | | - def run!(*args) deprecated(:run!, :execute); end |
309 | | - |
310 | | - # @deprecated Updated to use `Executor` instead of `Runnable` |
311 | | - def self.run!(*args, &block) |
312 | | - warn "[DEPRECATED] `run!` is deprecated, please use `execute` instead." |
313 | | - Concurrent::Runnable::Context.new(TimerTask.new(*args, &block)) |
314 | | - end |
315 | | - |
316 | | - # @deprecated Updated to use `Executor` instead of `Runnable` |
317 | | - def run |
318 | | - raise Concurrent::Runnable::LifecycleError.new('already running') if @running.true? |
319 | | - self.execute |
320 | | - self.wait_for_termination |
321 | | - true |
322 | | - end |
323 | | - |
324 | 295 | private :post, :<< |
325 | 296 |
|
326 | 297 | protected |
@@ -366,12 +337,5 @@ def timeout_task(completion) |
366 | 337 | observers.notify_observers(Time.now, nil, Concurrent::TimeoutError.new) |
367 | 338 | end |
368 | 339 | end |
369 | | - |
370 | | - # @deprecated Updated to use `Executor` instead of `Runnable` |
371 | | - # @!visibility private |
372 | | - def deprecated(old, new, *args) |
373 | | - warn "[DEPRECATED] `#{old}` is deprecated, please use `#{new}` instead." |
374 | | - self.send(new, *args) |
375 | | - end |
376 | 340 | end |
377 | 341 | end |
0 commit comments