code: func (b *Broker) consumeDeliveries(deliveries <-chan *awssqs.ReceiveMessageOutput, concurrency int, taskProcessor iface.TaskProcessor, pool chan struct{}, errorsChan chan error) (bool, error) {
  	select {
  	case err := <-errorsChan:
  		return false, err
  	case d := <-deliveries:
  		if concurrency > 0 {
  			// get worker from pool (blocks until one is available)
  			<-pool
  		}
  
  		b.processingWG.Add(1)
  
  		// Consume the task inside a goroutine so multiple tasks
  		// can be processed concurrently
  		go func() {
  
  			if err := b.consumeOne(d, taskProcessor); err != nil {
  				errorsChan <- err
  			}
  
  			b.processingWG.Done()
  
  			if concurrency > 0 {
  				// give worker back to pool
  				pool <- struct{}{}
  			}
  		}()
  	case <-b.GetStopChan():
  		return false, nil
  	}
  	return true, nil
  }
docs: // consumeDeliveries is a method consuming deliveries from deliveries channel