Documentation ¶
Overview ¶
Package dchan provides an elastic event channel implementation and a Chan interface, unifying all the go channel types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chan ¶
type Chan interface { // Send event to a channel. Send(v stream.Event) // Receive event and closed flag from a channel. Recv() (stream.Event, bool) // Number of events in the channel buffer. Len() int // Maximum possible number of events in the channel buffer. Cap() int // Close the channel. Close() // Free the underlying resources of a closed channel. // Call this function after Close and before channel is empty. Done() }
Channel interface.
func ChanDyn ¶
func ChanDyn() Chan
Get an implementation of Chan interface for elastic channel: the channel with infinite, dynamically growing buffer.
func ChanDynBuf ¶
Get an implementation of Chan interface for elastic channel: the channel with infinite, dynamically growing buffer with specified initial buffer sise. TODO: make buffefred chennels possible. THe problem now is when isClosed is true and we do not drain the buffered add channel.
Click to show internal directories.
Click to hide internal directories.