Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

adonis-scheduler

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adonis-scheduler

Easy task scheduling for AdonisJS

  • 2.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
increased by6.36%
Maintainers
1
Weekly downloads
 
Created
Source

Adonis Scheduler Provider

This library provides an easy way to schedule recurring tasks for AdonisJS.

Install

npm install --save adonis-scheduler

Configure

Register it in bootstrap/app.js:

const providers = [
  ...
  'adonis-scheduler/providers/SchedulerProvider'
]

const aliases = {
  ...
  Scheduler: 'Adonis/Addons/Scheduler'
}

Register the commands:

const aceProviders = [
  ...
  'adonis-scheduler/providers/CommandsProvider'
];

...

const commands = [
  ...
  'Adonis/Commands/Scheduler:Run'
];

Usage

Starting the scheduler

Starting an instance of the kue listener is easy with the included ace command. Simply run ./ace scheduler:run.

The provider looks for jobs in the app/Tasks directory of your AdonisJS project and will automatically register a handler for any tasks that it finds.

Creating your first task

Jobs are easy to create. They live in app/Tasks and they are a simple class. They expose the following properties:

NameRequiredTypeStaticDescription
scheduletruemanytrueThe schedule for which the task should run. More docs.
handletruefunctionfalseA function that is called for this task.

Here's an example.

Thanks

Special thanks to the creator(s) of AdonisJS for creating such a great framework.

Keywords

FAQs

Package last updated on 03 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc