func (c *Consumer) Register(topic, channel string, maxInFlight int, handler Handler) error {
	tch := topicChan{topic, channel}
	var config *nsq.Config
	if c.Config == nil {
		config = nsq.NewConfig()
		config.Set("verbose", DefaultVerbose)
		config.Set("max_in_flight", maxInFlight)
	} else {
		config = c.Config
	}
	r, err := nsq.NewConsumer(topic, channel, config)
	if err != nil {
		return err
	}
	r.SetLogger(c.Logger, c.LogLevel)
	q := &queue{handler, r}
	r.AddConcurrentHandlers(q, maxInFlight)
	c.handlers[tch] = q
	return nil
}
Register - Registers topic/channel handler for messages
This function creates a new nsq.Reader
package consumer
import (
	"log"
	"github.com/crackcomm/nsqueue/nsqlog"
	"github.com/nsqio/go-nsq"
)
type topicChan struct {
	topic   string
	channel string
}
type Consumer struct {
	Logger   *log.Logger
	LogLevel nsq.LogLevel
	Config   *nsq.Config
	handlers map[topicChan]*queue
}
var DefaultVerbose = false
func New() *Consumer {
	return &Consumer{
		Logger:   nsqlog.Logger,
		LogLevel: nsqlog.LogLevel,
		handlers: make(map[topicChan]*queue),
	}
}