func (q *PayloadQueue) Enqueue(payload Payload) {
	size := len(q.queue)
	idx := 0
	if size > 1 {
		idx = dice.Roll(size)
	}
	for i := 0; i < size; i++ {
		select {
		case q.queue[idx%size] <- payload:
			return
		default:
			idx++
		}
	}
}
// Enqueue adds the payload to the end of this queue.
Enqueue adds the payload to the end of this queue.
// Enqueue adds the payload to the end of this queue .
func (q *PayloadQueue) Enqueue(payload Payload) {
	size := len(q.queue)
	idx := 0
	if size > 1 {
		idx = dice.Roll(size)
	}
	for i := 0; i < size; i++ {
		select {
		case q.queue[idx%size] <- payload:
			return
		default:
			idx++
		}
	}
}
func ( q * PayloadQueue ) Enqueue ( payload Payload ) { size := len ( q . queue ) idx := 0 if size > 1 { idx = dice . Roll ( size ) } for i := 0 ; i < size ; i ++ { select { case q . queue [ idx % size ] <- payload : return default : idx ++ } } }
Enqueue adds the payload to the end of this queue.
Enqueue adds the payload to the end of this queue .