PHP library for Redis sets, MQ, and more — ordered by priority.
sadd(string $key, mixed ...$members): int // Add one or more members
srem(string $key, mixed ...$members): int // Remove one or more members
smembers(string $key): array // Return all members
sismember(string $key, mixed $member): bool // Check if a member exists
scard(string $key): int // Count memberssinter(string ...$keys): array // Intersection
sunion(string ...$keys): array // Union
sdiff(string $key, string ...$keys): array // Differencerpush(string $key, mixed ...$values): int // Producer: push a message
lpop(string $key): mixed // Non-blocking consumer
lmpop(string $key): array
llen(string $key): int // Queue lengthProducer → LPUSH queue "message"
Consumer → BRPOP queue 0 // blocks until a message arrives
publish(string $channel, mixed $message): int // Publish a message
subscribe(string ...$channels): void // Subscribe to channels
unsubscribe(string ...$channels): void // Unsubscribe
psubscribe(string ...$patterns): void // Pattern matching e.g. "user.*"// * = auto-generated id
xadd(string $key, array $message, string $id = '*'): string
// Simple read
xread(array $streams, int $count = null, int $block = null): array
// Read via consumer group
xreadgroup(string $group, string $consumer, array $streams, int $count = null): array
// Acknowledge a processed message
xack(string $key, string $group, string ...$ids): int
// Manage consumer groups
xgroup(string $op, string $key, string $group, string $id = '0'): mixed
// Number of messages in the stream
xlen(string $key): intLists → simple, no ack, fire & forget
Streams → persistent, ack, consumer groups, replayable ← Kafka-like
@See you space cowboy... 🚀