Redis Task Scheduler
This module schedules tasks that will be run with https://github.com/mikesparr/redis-docker-taskrunner
Requirements
Redis must be installed and running, or accessible via network.
Install
npm install redis-task-scheduleryarn add redis-task-scheduler
Test
Tests are in src/__tests__
and src/lib/__tests__
respectively. The app is built in
Typescript but compiles to .js
files.
npm testnpm run coverage # optional
Usage
Quick start (node)
const redis = ;const rts = ; const client = redis;const scheduler = null client; // create a jobconst testTask = rtsTaskTypePubSub "myPubSubChannel" foo: "bar";const testJob = `job-` // id testTask // task null // lastRun 5 // interval in minutes 3 // recurrences 0 // runCount; // schedule itscheduler ;
Typescript
;; ;; // create a job;; // schedule itscheduler.scheduleTaskChannel.Default, testJob .then .catch;
Contributing
I haven't thought that far ahead. I needed this for my own project and decided to give back.
License
MIT