redis
Redis client for caching, pub/sub and queue operations. Supports strings, hashes, lists with TTL and atomic counters.
Install
ppm install redis
Usage Example
uses redis;
var r := Connect('localhost', 6379);
// Cache with 1-hour TTL
Set(r, 'session:abc', userJSON, 3600);
var data := Get(r, 'session:abc');
// Atomic counter
Incr(r, 'page_views');
// Task queue
LPush(r, 'tasks', taskJSON);
var task := RPop(r, 'tasks');
// Hash
HSet(r, 'user:42', 'name', 'Alice');
var name := HGet(r, 'user:42', 'name');
// Pub/Sub
Publish(r, 'events', 'user_login:42');
Features
String, Hash, List, Set operations
Pub/Sub messaging channels
TTL expiry for cached values
Atomic INCR/DECR counters
Pipeline support for batch ops