Esempio n. 1
0
// Get gets from given queue
func Get() {
	var d *disque.Disque
	var err error
	d, err = p.Get(context.Background()) // get a connection from the pool
	if err != nil {
		log.Println(err)
	}

	_, err = d.Fetch(queueName, time.Second*1)
	if err != nil {
		log.Fatal(err)
	}
	p.Put(d) // return a connection to the pool

}