@grandlinex/bundle-cron
v1.0.1
Published
> Cron support for GrandLineX
Downloads
7
Maintainers
Readme
GrandLineX Cron Bundle
Cron support for GrandLineX
Description
GrandLineX is an out-of-the-box server framework.
Status
Issues
Install
Example
class TestKernel extends CoreKernel<any> {
constructor(appName:string, appCode:string) {
super( { appName, appCode});
// ...
/**
* Add the module to the kernel
*/
this.addModule(new CronModule(this));
/**
* Define kernel event
*/
this.on("test-trigger",()=>{
console.log("test-trigger");
})
/**
* Add cron timer
*/
const mod = kernel.getChildModule('cron') as CronModule;
const client = mod.getClient() as CronClient;
client.registerCron({
trigger: 'test-trigger',
name: 'test',
cron: '0 * * * *',
});
}
}