1.1.2 • Published 4 years ago
@essential-projects/scheduler_extension v1.1.2
Scheduler Extension
This is an extension for the @essential-projects/bootstrapper.
What are the goals of this project?
The goal is to provide applications that utilize the @essential-projects/bootstrapper. a way to execute functions based on a schedule.
Requirements
- Node >
10.15.0
Setup/Installation
Install the extension and its contracts:
npm install \
@essential-projects/scheduler_extension \
@essential-projects/scheduler_contracts
How do I use this project?
Create a Scheduler Router
import {BaseController} from '@essential-projects/scheduler_extension'; export class MySchedulerController extends BaseController { public initializeScheduler(): void { this.registerJobs(); } private registerJobs(): void { this.registerJob('*/5 * * * * *', (): void => { console.log("I'm scheduled to run every 5 seconds!"); }); } }
Register that Controller with the schedulerDiscoveryTag
import {MySchedulerController} from './my_scheduler_controller'; import {schedulerDiscoveryTag} from '@essential-projects/scheduler_contracts'; iocContainer.register('MySchedulerController', MySchedulerController) .tags(schedulerDiscoveryTag) .singleton(); }
Register the extension to the ioc-container
const {registerInContainer} = await import('@essential-projects/scheduler_extension/ioc_module'); registerInContainer(iocContainer);
When starting the bootstrapper, it will now discover the extension. The extension will then discover the registered schedulers, register all the jobs and schedule their execution.
Authors/Contact information
1.1.2-678d24ea-b9
4 years ago
1.1.2
5 years ago
1.1.2-5bab4e4f-b8
5 years ago
1.1.1-b7b21b63-b7
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.1.0-f0ebcb25-b6
5 years ago
1.1.0-044c824d-b5
5 years ago
1.1.0-5f3b2f5e-b6
5 years ago
1.1.0-d233ad60-b5
5 years ago
1.1.0-f574f0fb-b4
5 years ago
1.1.0-f8733785-b3
5 years ago
1.1.0-2cf11b3a-b2
5 years ago
1.0.0-76f89140-b1
5 years ago
1.0.0-76f89140-b4
5 years ago
1.0.0-76f89140-b3
5 years ago
1.0.0
5 years ago