Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

silentroach/redis-pulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redis Pulse

npm

Simple redis heartbeat. It will send ping command to connection repeatedly while it is open.

Depends on redis npm package as a peer.

Installation

npm i redis-pulse --save

API

Module is just one method, that will get your connection as an argument and return it.

pulse(redisClient, options)

  • redisClient - any redis client (redis.creteClient() result)
  • options
    • timeout - time in ms between pings

Example

Just that simple:

const redis = require('redis');
const pulse = require('redis-pulse');

const client = pulse(redis.createClient());