@pointblankdev/gather-scheduler

0.1.1 • Public • Published

@pointblankdev/gather-scheduler

@pointblankdev/gather-scheduler is a wapper around the agendajs package which returns a connected aganda instance to a mongodb service.

Installation

yarn add @pointblankdev/gather-scheduler

Usage

import {Agenda} from "@pointblankdev/gather-scheduler"

# define a job and instatenoisly schedule the job
Agenda.define(
  "send a reminder to get me ice-cream",
  { priority: "high", concurrency: 10 },
  async (job) => {
    const { to } = job.attrs.data;
    await email.send({
      to,
      from: "example@example.com",
      subject: "Get me ice-cream",
      body: "You definately dont want to forget, smiles .....",
    });
  }
);

(async function () {
  await agenda.start();
  await Agenda.schedule("in 20 minutes", "send email report", {
    to: "anyone@example.com",
  });
})();



Checkout [agendajs](https://www.npmjs.com/package/agenda) for more about [agendajs](https://www.npmjs.com/package/agenda)

Readme

Keywords

none

Package Sidebar

Install

npm i @pointblankdev/gather-scheduler

Weekly Downloads

1

Version

0.1.1

License

ISC

Unpacked Size

4.64 kB

Total Files

23

Last publish

Collaborators

  • sijupoint
  • victor_dev
  • atuki
  • yungdenzel
  • naalaryea
  • laoye_jnr
  • pointblankigbominadeveloper
  • rozar