This Python script showcases a multi-threaded producer-consumer system using Redis Streams and consumer groups.
- Redis Streams: A log-like data structure in Redis, ideal for real-time data ingestion and processing.
- Producer (
writer
): Continuously pushes randomized market data to a Redis stream. - Consumer (
reader
): Reads new entries from the stream via a consumer group, acknowledges processed items, and deletes them to avoid reprocessing. - Threading: Two threads are used to simulate concurrent real-world producer-consumer scenarios.