func New()

in pkg/ringbuffer/ringbuffer.go [41:56]


func New(bufferCount int, pool *bufferpool.BufferPool) *RingBuffer {
	if bufferCount == 0 {
		log.Error("The initial size of a queue should be larger than 0")
		os.Exit(1)
	}
	capacity := getChannelSize(bufferCount)
	channel := make(chan *tracesegment.TraceSegment, capacity)

	return &RingBuffer{
		Channel: channel,
		c:       channel,
		Empty:   false,
		count:   0,
		pool:    pool,
	}
}