MathieuTurcotte/node-backoff — pull request #7 by deestan (2014-03-13 14:28:40+00:00)
Title: Introduced resetInterval.

I have a use case where I want to apply the backoff strategy to keeping a server process running. More abstractly, I want to apply the backoff strategy to a long-living object instead of a single operation.

Let's say a problem occurs that causes my process to crash repeatedly but eventually come back up (backing database goes down, disk full, temporary network failure, configuration file syntax error...). I wish to apply a backoff strategy to the restarting of this service, to avoid it spamming logs, network, CPU, database, etc. Let's say 1-60 seconds exponential.

I also want the backoff to start from fresh after a period of non-crashing. I.e. if the database restarts a few days after a previous failure, I want the backoff to start again from 1 second, and not immediately continue at 60 seconds.

I could do this in my own code by keeping track of the Backoff object's events and calling `reset()` after a given timeout, but it seems cleaner and less brittle to allow for this in the backoff library.