redis_wrapper

A Wrapper using a single connection and logging for redis-dart


License
AGPL-3.0

Documentation

Build Status

A simple wrapper for redis-dart that provides logging and manages a single redis connection as recommended by the author of redis-dart for maximum performance. Currently it relies on some modifications of redis-dart, when these are merged the dependencies are modified to the current upstream version.

Usage

A simple usage example:

import 'package:redis_wrapper/redis_wrapper.dart';

main() async {
    final RedisWrapper redis = RedisWrapper();
  
    // Use it for transactions
    Transaction ta = await redis.multi();
    unawaited(ta.send_object(["SADD", "project_ids", newId]));
    
    if(await ta.exec() != "OK") {
      logger.severe("Could not add id");
    };
    
    // Use it for commands
    String result = await redis.send(["SMEMBERS", "project_ids"]);
    
    // Close Connection
    await redis.close();
}