Python multiple reader stream

Viewed 85

I wanted to build a custom kind of file object (stream) in python. This is a read-only file pointer. The idea is that you can “copy” the object, and then pass different copies to different processes. Each process will read the full stream, but the core class will block calls to read if one process is too far ahead of the others. That way you can store a finite amount in memory, but still let all consumers read the whole stream.

Does such a class already exist? If not, how do I go about building this?

0 Answers
Related