Beispiel #1
0
func main() {
	e := env.Init()
	r := coelho.Rabbit{}
	r.Exchange = e.Exchange
	r.ExchangeType = e.ExchangeType
	r.Durable = e.Durable
	r.Delete = e.Delete
	r.Exclusive = e.Exclusive
	r.NoWait = e.NoWait
	r.QoS = 100
	flag.Parse()
	go dispatch(e, r, "offer.click")
	go dispatch(e, r, "catalog.view")
	<-ctx.Done()
}
Beispiel #2
0
func main() {
	e := env.Init()
	r := coelho.Rabbit{}
	r.Exchange = e.Exchange
	r.ExchangeType = e.ExchangeType
	r.Durable = e.Durable
	r.Delete = e.Delete
	r.Exclusive = e.Exclusive
	r.NoWait = e.NoWait
	flag.Parse()
	go func() {
		r.Publish(ctx, r.Redial(ctx, e.RabbitMqAddres), read(os.Stdin), "all")
		done()
	}()

	<-ctx.Done()
}