1.0.1 • Published 12 months ago

@grandlinex/bundle-cron v1.0.1

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
12 months ago

GrandLineX Cron Bundle

Cron support for GrandLineX

Description

GrandLineX is an out-of-the-box server framework.

GitHub NPM TS

Status

Quality Gate Status Security Rating Maintainability Rating Reliability Rating Coverage

Issues

Bugs Vulnerabilities Code Smells

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 * * * *',
      });
  }
}

Documentation

1.0.1

12 months ago

1.0.0

12 months ago