code: func New(logLevel logrus.Level, requestTimeout ...time.Duration) *Client {
  	l := logrus.New()
  	l.Formatter = &logrus.TextFormatter{}
  	l.SetLevel(logLevel)
  
  	logger.Log = l
  
  	reqTimeout := 5 * time.Second
  	if len(requestTimeout) > 0 {
  		reqTimeout = requestTimeout[0]
  	}
  
  	return &Client{
  		Connected:       false,
  		packetEncoder:   codec.NewPomeloPacketEncoder(),
  		packetDecoder:   codec.NewPomeloPacketDecoder(),
  		packetChan:      make(chan *packet.Packet, 10),
  		pendingRequests: make(map[uint]*pendingRequest),
  		requestTimeout:  reqTimeout,
  		// 30 here is the limit of inflight messages
  		// TODO this should probably be configurable
  		pendingChan:    make(chan bool, 30),
  		messageEncoder: message.NewMessagesEncoder(true),
  	}
  }
docs: // New returns a new client