Skip to content

Repository files navigation

BITBEAT REDIS MODULE

Introduction

This is the official redis module for bitbeat using ioredis for connection.
This package will export you a redis connector and a redis config.
To use it follow the documentation of bitbeat at the homepage.

Example register:

import{registerBulk}from'@bitbeat/core';import{RedisConnector,RedisConfig}from'@bitbeat/redis';exportdefaultasync()=>{// it does not matter if you use new Set([RedisConfig, RedisConnector]) or new Set([RedisConnector, RedisConfig]).// Configuration files will always be loaded first + the priorities are the important sorter.awaitregisterBulk(newSet([RedisConfig,RedisConnector]));};

Example usage:

import{getInstance,Task}from'@bitbeat/core';import{RedisConnector}from'@bitbeat/redis';exportdefaultclassTestextendsTask{constructor(){super();this.schedule='* * * * *';}asyncrun(): Promise<void>{// set each minute a new timestampconstredis=getInstance(RedisConnector)?.runtime;awaitredis.set('timestamp',Date.now());}}

Releases

Packages

Used by

Contributors

Languages