I want to cancel timer.wait from another thread, is this possible?
HongliYu opened this issue · 4 comments
HongliYu commented
timers = Timers::Group.new
five_second_timer = timers.after(10) { Thread.kill(runningThread) }
runningThread = Thread.new do
# this task cost me 5 seconds, then I want to cancel the timer from status of waiting ,is this possible?
end
timers.wait
tarcieri commented
The timers gem presently does not have cross-thread support. If you would like something like this, I would suggest using Celluloid
ioquatix commented
Perhaps you can explain a bit more what you are trying to achieve?
digitalextremist commented
And feel free to take this to the Google Group where we discuss things like this all the time.