Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

Instantly update timer interval when using Timer#interval= #104

Open
dominikh opened this issue Oct 27, 2012 · 6 comments
Open

Instantly update timer interval when using Timer#interval= #104

dominikh opened this issue Oct 27, 2012 · 6 comments
Labels

Comments

@dominikh
Copy link
Member

No description provided.

@mrageh
Copy link

mrageh commented Jun 21, 2013

Hi I don't understand exactly what you mean with that question?

@dominikh
Copy link
Member Author

I did not ask a question, I filed a task.

Currently, when using Timer#interval= to change a timer's interval, it will still use the previous interval for the next tick, before it switches to the new interval.

@mrageh
Copy link

mrageh commented Jun 22, 2013

Hi Domink
I did not intend to offend am just a beginner, I have tried to find this timer#interval to see if i can fix it
and logically speaking should it not be in timer.rb?
Only been programming for 1 month and 2 weeks :)

@dominikh
Copy link
Member Author

Not offended here.

Yes, it's in /lib/cinch/timer.rb. Currently it's a plain attribute accessor (attr_accessor :interval).

@mrageh
Copy link

mrageh commented Jun 22, 2013

And if I understand correctly you want it to instantly update?

@dominikh
Copy link
Member Author

I want that setting a new interval will abort the current sleep period and start with the new interval, yes.

Currently, if you have a timer with an interval of say 1 hour, and after 2 minutes you change the interval to 1 second, it will still take 58 minutes before the timer fires and uses the new interval.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants