code: func (b *PayloadsBufferImpl) drainReadChannel() {
  	if len(b.buf) == 0 {
  		for {
  			if len(b.readyChan) > 0 {
  				<-b.readyChan
  			} else {
  				break
  			}
  		}
  	}
  }
docs: // drainReadChannel empties ready channel in case last
  // payload has been poped up and there are still awaiting
  // notifications in the channel