0 purchases
dart redis connector
Redis Connector #
A base implementation of managing a connection to a Redis server in Dart.
Redis Clients for Dart, such as Dart Redis use this to implement underlying connections.
This connector does not implement connection monitoring or retry logic, clients
should implement this logic themselves, since this behavior can differ between client types, e.g. standalone Redis server vs a Redis cluster.
Features #
SCAN support via Streams.
PUB/SUB support via Streams.
Support for streaming connection state changes.
Full support for parsing Redis connection options from a URI via RedisOptions.fromUri(uri).
Usage #
import 'package:dart_redis_connector/dart_redis_connector.dart';
Future<void> main(List args) async {
final redisOptions = RedisOptions();
final redis = RedisConnector(redisOptions);
await redis.connect();
final keys = await redis.scan('scan', match: '*123*').toList();
print(keys); // [ ... keys ]
final setReply = await redis.send<String>('SET', args: ['key', 'value']);
final getReply = await redis.send<String?>('GET', args: ['key']);
print(setReply.value); // OK
print(getReply.value); // value
}
copied to clipboard
Built and maintained by Invertase.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.