redis_wrapper 1.0.1 redis_wrapper: ^1.0.1 copied to clipboard
A Wrapper using a single connection and logging for redis-dart
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();
}