Output reader/writer
- class pssh.clients.reader.ConcurrentRWBuffer
Concurrent reader/writer of bytes for use from multiple greenlets.
Supports both concurrent reading and writing and combinations there of.
Iterate on buffer object to read data, yielding event loop if no data exists until self.eof has been set.
Check if end-of-file without blocking with
ConcurrentRWBuffer.eof.is_set()
.Writers should call
ConcurrentRWBuffer.eof.set()
when finished writing data viawrite
.Readers can use
read()
to get any available data orNone
.- read()
Read available data, or return None.
- Return type:
bytes
- write(data)
Write data to buffer.
- Parameters:
data (bytes) – Data to write
- eof