func NewProducer1(n int, every time.Duration) *Producer1 {
	p := &Producer1{n: n, id: 0}
	p.Out = make(chan Packet)
	p.tick = time.NewTicker(every)
	p.quit = make(chan chan int)
	go p.run()
	return p
}
NewProducer1 creates and returns a new producer that emits packets
with random selectors in range [0..n) periodically (one every
"every" argument).
package main
import (
	"log"
	"math/rand"
	"time"
)
type Producer1 struct {
	Out  chan Packet
	n    int           
	id   int           
	tick *time.Ticker  
	quit chan chan int
}