Skip to content

Commit edcb76b

Browse files
committed
Redefine kill, which was relying on incorrect @queue.clear in shutdown
1 parent cf61bcc commit edcb76b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/concurrent/executor/timer_set.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ def post(intended_time, *args, &task)
6161

6262
end
6363

64-
alias_method :kill, :shutdown
64+
# For a timer, #kill is like an orderly shutdown, except we need to manually
65+
# (and destructively) clear the queue first
66+
def kill
67+
@queue.clear
68+
shutdown
69+
end
6570

6671
# Calculate an Epoch time with milliseconds at which to execute a
6772
# task. If the given time is a `Time` object it will be converted

0 commit comments

Comments
 (0)