【文件属性】:
文件名称:daemonizejs:我的守护程序插件的非jQuery版本
文件大小:3KB
文件格式:ZIP
更新时间:2021-05-29 14:01:00
JavaScript
守护进程
Daemonize 是一个工具,它接受一个方法并返回一个具有类似守护进程的接口(启动、停止、重启)的函数。
用法
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.
您还可以指定在守护程序停止后在重新启动调用时运行的函数。
var reinit = function () {
// Clean up
};
var daemo
【文件预览】:
daemonizejs-master
----.gitignore(37B)
----LICENSE(1KB)
----README.md(705B)
----daemonize.js(3KB)