@optask/storage-redis
v1.2.1
Published
An implementation of tasker Storage using redis
Downloads
203
Readme
@optask/storage-redis
A simple wrapper around ioredis
to implement a basic storage from @optask/tasker
.
Will utilize redis strings to store task state.
Quickstart
Install the package:
yarn add @optask/tasker @optask/storage-redis
When you are configuring the scheduler, set the storage mechanism:
import { TaskScheduler } from '@optask/tasker';
import { RedisStore } from '@optask/storage-redis';
const scheduler = new TaskScheduler();
scheduler.registerStore(
new RedisStore({
host: 'localhost',
port: 6379,
namespace: 'tasker',
}),
);
Note that namespace is a required parameter that defines how the key space will be prefixed. All other options inherit from ioredis options, see the ioredis docs here