phergie / phergie-irc-client-react

IRC client library built on React
BSD 3-Clause "New" or "Revised" License
57 stars 26 forks source link

Missing "tick" event. #4

Closed stil closed 11 years ago

stil commented 11 years ago

I think that Phergie client needs "tick" event. Without it, we cannot implement many time-based tools. Phergie 2 has such event and it is impossible to port plugins into new Phergie.

avdg commented 11 years ago

Can you please give a few examples of plugins which are impossible to port. Others might be interested to port these plugins and may come to the same conclusion as yours.

Thanks for helping.

On 6 September 2013 12:07, stil notifications@github.com wrote:

I think that Phergie client needs "tick" event. Without it, we cannot implement many time-based tools. Phergie 2 has such event and it is impossible to port plugins into new Phergie.

— Reply to this email directly or view it on GitHubhttps://github.com/phergie/phergie-irc-client-react/issues/4 .

stil commented 11 years ago

The example can be my own "Shout" plugin, which sends annoucement messages every 15 minutes. Phergie 2 has Cron plugin, which relies on tick events. There is also FeedTicker plugin, quite similiar to my plugin.

igorw commented 11 years ago

Note: If you expose the react loop you could add timers to it directly.

elazar commented 11 years ago

@igorw Thanks, that thought had occurred to me. :) I'll see what I can do about implementing this soon if someone doesn't beat me to it.

The addPeriodicTimer() call in this example is what @igorw is referring to, for those curious.

stil commented 11 years ago

@igorw: I didn't know about that feature. That solves the case for me, thanks for your help very much.

elazar commented 11 years ago

Added convenience proxy methods in e4ed88df650e3388666e97727bc4865d4371b35b. Does this satisfy your use case?

stil commented 11 years ago

I've already implemented timers in my bot, but that proxy methods make it more convenient to use. Thanks for fix.