worktop-quirrel
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

This package is currently a work-in-progress and should not be used.

Changes

Example Usage

import { Router } from 'worktop';
import * as Cache from 'worktop/cache';
import { Queue } from 'worktop-quirrel';

const API = new Router();

const ExampleJob = new Queue<Record<string, string>>(
  'job/call',
  (object) => {
    console.log("Job run!");
    console.log(object);

    return Promise.resolve();
  }
);

ExampleJob.addToRouter(API);
API.add('GET', '/job/trigger', async (request, response) => {
  await ExampleJob.enqueue({ "example": "payload" }, { delay: 2000 });
  response.send(200);
});

Cache.listen(API.run.bind(this));

Readme

Keywords

none

Package Sidebar

Install

npm i worktop-quirrel

Weekly Downloads

7

Version

0.0.6

License

MIT

Unpacked Size

287 kB

Total Files

11

Last publish

Collaborators

  • mattwebbio