Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Iterator ¶
type Iterator[T interface{}] interface { // Next returns the next item, or an error. All errors are terminal; no more values // will arrive after the first error. Next() (T, error) // Close the consumer side of the Iterator. Must always be called when // the iterator is no longer used, to release resources. Close() }
Iterator is a generic interface for streaming a series of item, with support for back-pressure.
type Producer ¶
type Producer[T interface{}] struct {
// contains filtered or unexported fields
}
func NewBufferedProducer ¶
func NewProducer ¶
func NewProducer[T interface{}]() *Producer[T]
func (*Producer[T]) Error ¶
Error closes the producer with the provided error. If the error is `nil`, io.EOF will be used instead to indicate a nice close.
Click to show internal directories.
Click to hide internal directories.