redis-speed
An utility for redis aim to improve the performance of redis, it includes FlashCacheRedis
now.
FlashCacheRedis
Save value in memory to reduce the frequency of reading redis.
Usage
const FlashCacheRedis = ;const Redis = ;const redisClient = ;//connect to the redis server of localhost:6379const cacheQueryAdapter = redisClient//the redis client object interval:1000;const expect = ;const KEY = 'flash_cache_redis:basic';const VALUE = name:'sunny'id:1; redisClient;
RedisHelper
An utility class to do parallel job with redis. If your redis is run in cluster mode, it will not return the data properly with some functions, such as pipeline
or mutil
. RedisHelper
is designed to resoved such issue.
Usage
const RedisHelper = ;const key1 = 'key1';const value1 = Math + '';const key2 = 'key2';const value2 = Math + '';const tasks = 'set'key1value1 'set'key2value2;redisHelper;
redisBatchIncr
An utility class to send redis command in batch.
Usage
const redisBatchIncr: EVENT_ONE_LOOP_FINISHED EVENT_SEND_ERROR BatchHincr BatchZincrby }} = ;const redisClient = ;//connect to the redis server of localhost:6379 const LOOP_COUNT = 100;const INTERVAL = 200;const key = 'test:' + Math;const cmd = redisClientloopInterval:INTERVALkey; cmd;cmd; forvar i=0;i<LOOP_COUNT;i++ cmd;
redisMultiBatchIncr
An utility class to send redis command in batch with multiple keys.
Usage
const redisMultiBatchIncr: EVENT_ONE_LOOP_FINISHED EVENT_SEND_ERROR BatchMultiHincr BatchMultiZincrby }} = ;const redisClient = ;//connect to the redis server of localhost:6379 const LOOP_COUNT = 100;const INTERVAL = 200; const cmd = redisClientloopInterval:INTERVAL;const key = 'test:' + Math;cmd;cmd; forvar i=0;i<LOOP_COUNT;i++ cmd;