boss-intervals
If you need to manage intervals/timers/loops ( expecially on raspberry side, it's specially useful in use in graceful shutdown of the process ) this module is for you . with this simple module you can create intervals and timers and have a common manager for everythings. .
An example to use in graceful shutdown
var intervals = ; intervals; intervals; intervals; process;
example with timeout
var intervals = ; intervals; intervals; intervals; ;
You can also use a special events in every intervals/timers
var intervals = ; var timer = intervals; // Before the timer is initializated and ready to starttimer; // before the first line of code of your function (for every interaction)timer; // after the last line of code of your function (for every interaction)timer; // when the timer is terminated ( if you shutdown the timer // when it is ongoing the timer will be terminated and than // will be catched this event )timer; ;
The example below show how you can manage if a variable is free to use
var intervals = ;var a = 1; var timer_1 = intervals; var timer_2 = intervals;
BYE BYE GUYS