Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosed = fmt.Errorf("MultiReaderBuffer already closed for writes")
Functions ¶
This section is empty.
Types ¶
type MultiReaderSingleWriterBuffer ¶
type MultiReaderSingleWriterBuffer struct { // Writer's public fields, can be set before calling Write(); FlushThresholdBytes int // contains filtered or unexported fields }
MultiReaderSingleWriterBuffer manages a byte buffer that can be appended to by one goroutine (via Write()) while many readers read from the same buffer via Reader(). Readers block in Read() until data is available. The writer must call Close() to flush the final block of data to the readers.
The buffer is never discarded; even after the writer calls Close, new readers can still begin reading the buffer.
func New ¶
func New(initialBufSize int) *MultiReaderSingleWriterBuffer
func (*MultiReaderSingleWriterBuffer) Close ¶
func (m *MultiReaderSingleWriterBuffer) Close() error
func (*MultiReaderSingleWriterBuffer) Len ¶
func (m *MultiReaderSingleWriterBuffer) Len() int
func (*MultiReaderSingleWriterBuffer) Reader ¶
func (m *MultiReaderSingleWriterBuffer) Reader() *Reader
Click to show internal directories.
Click to hide internal directories.