A simple Promise-based weighted round-robin pool implementation using Redis sorted sets and lists. Version 0.2.1 is the latest and only release. Provides basic peer management (add, remove, getNextPeer) with configurable weights per peer. Requires a running Redis server. Written in TypeScript but compiles to JavaScript for use in ES5+ environments. Less feature-rich than alternatives like Bull, but lightweight and focused on weighted round-robin balancing.
npm install redis-weighted-poolNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: create pool with Redis config, add peer with weight, get next peer using weighted round-robin.
Only use RedisConfig for default connection; use null for client param if not providing existing client.
Check result for undefined or use isEmpty() before calling getNextPeer.
Ensure peerId uniqueness per channel, or remove before re-adding if updating weight.
Use new pool.RedisConfig('localhost', 6379, null, null) or use destructured imports.Start Redis server on localhost:6379 or update RedisConfig parameters.
Ensure RedisWeightedPool is instantiated with proper config object or null if passing client as second param.
Use import statements for ES modules: import { RedisWeightedPool } from 'redis-weighted-pool'