gregglind / micropilot

Lightweight event monitoring and observation in Firefox addons.
http://gregglind.github.com/micropilot/
4 stars 2 forks source link

Fuse() does not work on an interval #33

Open daviddahl opened 11 years ago

daviddahl commented 11 years ago

In trying to integrate cookiemonster with MicroPilot, I am attempting to use Fuse to run an upload every N seconds. I see the Fuse function run, but there is no subsequent execution of the callback function. See https://github.com/mozilla/cookiemonster/commit/78967b4dd05f453759fbd13aac64a90a17375c50

There is a second commit with some additional tweaks: https://github.com/mozilla/cookiemonster/commit/0b559b7d1113b43b1a8e3c15125c36ab63ad3432

gregglind commented 11 years ago

Ddahl, issue is not clear to me. Can you schedule some time with me on vidyo next week to actually make me fix this, please :)

mozkeeler commented 11 years ago

I had to set duration to something large (e.g. Number.MAX_VALUE) to get this to work as expected. (The issue is that pulsefn only gets called once otherwise.)

monicachew commented 11 years ago

I recall seeing this working with 10 second intervals and a 1 minute duration, but maybe we're initializing our fuse in an unexpected way...

----- Original Message -----

I had to set duration to something large (e.g. Number.MAX_VALUE) to get this to work as expected. (The issue is that pulsefn only gets called once otherwise.) — Reply to this email directly or view it on GitHub .

gregglind commented 11 years ago

The interval isn't meant for repeat. I should write all this up better :).

Just use a timer if you want repeats :).

On May 9, 2013, at 8:28 PM, monicachew notifications@github.com wrote:

I recall seeing this working with 10 second intervals and a 1 minute duration, but maybe we're initializing our fuse in an unexpected way...

----- Original Message -----

I had to set duration to something large (e.g. Number.MAX_VALUE) to get this to work as expected. (The issue is that pulsefn only gets called once otherwise.) — Reply to this email directly or view it on GitHub . — Reply to this email directly or view it on GitHub.