MCPcopy Create free account
hub / github.com/eapache/channels / BatchingChannel

Struct BatchingChannel

batching_channel.go:6–11  ·  view source on GitHub ↗

BatchingChannel implements the Channel interface, with the change that instead of producing individual elements on Out(), it batches together the entire internal buffer each time. Trying to construct an unbuffered batching channel will panic, that configuration is not supported (and provides no bene

Source from the content-addressed store, hash-verified

4// on Out(), it batches together the entire internal buffer each time. Trying to construct an unbuffered batching channel
5// will panic, that configuration is not supported (and provides no benefit over an unbuffered NativeChannel).
6type BatchingChannel struct {
7 input, output chan interface{}
8 length chan int
9 buffer []interface{}
10 size BufferCap
11}
12
13func NewBatchingChannel(size BufferCap) *BatchingChannel {
14 if size == None {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected