socketry/timers

I want to cancel timer.wait from another thread, is this possible?

HongliYu opened this issue · 4 comments

    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

The timers gem presently does not have cross-thread support. If you would like something like this, I would suggest using Celluloid

Perhaps you can explain a bit more what you are trying to achieve?

And feel free to take this to the Google Group where we discuss things like this all the time.

Okay, I'll try Celluloid, thank you.@tarcieri