Documentation ¶
Overview ¶
Package fanoutwriter provides the FanoutWriter structure, which is a buffer which may be written to and subsequently read from multiple variable speed readers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFellBehind = errors.New("reader fell behind the writers buffer limit") ErrWriteWouldCauseFallBehind = errors.New("writing larger than the fanout limit will result in all readers falling behind") )
Functions ¶
This section is empty.
Types ¶
type FanoutWriter ¶
type FanoutWriter interface { io.WriteCloser NewReader() io.ReadCloser // Returns a new reader which begins reading depending on the configuration }
FanoutWriter is a io.WriteCloser which can spawn multiple io.ReadClosers that read at different speeds.
func NewDefaultFanoutWriter ¶
func NewDefaultFanoutWriter() FanoutWriter
NewDefaultFanoutWriter creates a new FanoutWriter with no initial data and with no buffer limit.
func NewFanoutWriter ¶
func NewFanoutWriter(c *FanoutWriterConfig) FanoutWriter
NewFanoutWriter creates a new FanoutWriter with the configuration passed.
type FanoutWriterConfig ¶
Click to show internal directories.
Click to hide internal directories.