Пример #1
0
func ProducerFunc(rb *rb.RingBuffer, index, size int) {
	for i := 0; i < size; i++ {
		rb.Write(i)
	}

}
Пример #2
0
func ConsumerFunc(rb *rb.RingBuffer, index, size int) {
	for i := 0; i < size; i++ {
		log.Println("[", index, "]: ", "consumer : ", i, ":", rb.Read())
		rb.Read()
	}
}