1.0.4 • Published 2 years ago

@hectortav/hermes v1.0.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Hermes

A persistent but minimal Redis job scheduler

Hermes is a minimal Node.js job scheduler. Hermes uses Redis to ensure reliability and job persistence between reloads and restarts. Hermes uses Typescript by default.

Install

# using npm
npm install @hectortav/hermes
# using yarn
yarn add @hectortav/hermes

Usage

import { Hermes } from "@hectortav/hermes";
// Connect Redis
const hermes = new Hermes({
    host: "127.0.0.1",
    port: 6379,
});

const main = async () => {
    // Create a handler
    hermes.addHandler({
        name: "console_log",
        func: ({ message }) => console.log(message),
    });
    // Create job
    hermes.schedule({
        // Choose a handler
        handler: "console_log",
        // Add a unique Id
        id: 13,
        // Expire in 45 seconds
        expiration: 45,
        // Add arguments for handler function
        args: { message: "hello world" },
    });
};

main();

Contributors

NameWebsite
hectortavhttps://github.com/hectortav
1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago