redis_wrapper 1.0.2 copy "redis_wrapper: ^1.0.2" to clipboard
redis_wrapper: ^1.0.2 copied to clipboard

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

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/redis.dart';
import 'package:redis_wrapper/redis_wrapper.dart';

main() async {
  final RedisWrapper redis = RedisWrapper();

  // Use it for transactions
  Transaction ta = await redis.multi();
  ta.send_object(["SADD", "project_ids", 1]);
  ta.send_object(["SADD", "project_ids", 2]);

  if(await ta.exec() != "OK") {
    print("Could not add id");
  };

  // Use it for commands
  String result = await redis.send(["SMEMBERS", "project_ids"]);

  // Close Connection
  await redis.close();
}
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

AGPL-3.0 (LICENSE)

Dependencies

logging, redis

More

Packages that depend on redis_wrapper