Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kapilkaisare/daemonizejs
A non jQuery version of my daemonizer plugin
https://github.com/kapilkaisare/daemonizejs
Last synced: 9 days ago
JSON representation
A non jQuery version of my daemonizer plugin
- Host: GitHub
- URL: https://github.com/kapilkaisare/daemonizejs
- Owner: kapilkaisare
- License: mit
- Created: 2014-08-02T04:47:33.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-18T04:11:47.000Z (over 9 years ago)
- Last Synced: 2024-08-01T13:34:10.591Z (3 months ago)
- Language: JavaScript
- Size: 410 KB
- Stars: 9
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
daemonizejs
===========Daemonize is a tool that takes a method and returns a function with a daemon like interface (start, stop, restart).
Usage
-----var testFun = function () {
// Do something
};var daemon = $.daemonize(testFun, 1000);
daemon.start(); // will run the testFun every second.
daemon.stop(); // will stop the testFun from running.
daemon.restart(); // will stop, then start the function.You can also specify a function that runs on the restart invocation once the daemon stops.
var reinit = function () {
// Clean up
};var daemon2 = $.daemonize(testFun, 1000, reinit);
daemon2.start();
daemon2.restart(); // stops testFun, runs reinit, then starts testFun again