code: func NewTransferQueue(dir Direction, manifest *Manifest, remote string, options ...Option) *TransferQueue {
  	q := &TransferQueue{
  		direction: dir,
  		client:    &tqClient{Client: manifest.APIClient()},
  		remote:    remote,
  		errorc:    make(chan error),
  		transfers: make(map[string]*objects),
  		trMutex:   &sync.Mutex{},
  		manifest:  manifest,
  		rc:        newRetryCounter(),
  	}
  
  	for _, opt := range options {
  		opt(q)
  	}
  
  	q.rc.MaxRetries = q.manifest.maxRetries
  	q.client.MaxRetries = q.manifest.maxRetries
  
  	if q.batchSize <= 0 {
  		q.batchSize = defaultBatchSize
  	}
  	if q.bufferDepth <= 0 {
  		q.bufferDepth = q.batchSize
  	}
  	if q.meter != nil {
  		q.meter.Direction = q.direction
  	}
  
  	q.incoming = make(chan *objectTuple, q.bufferDepth)
  	q.collectorWait.Add(1)
  	q.errorwait.Add(1)
  	q.run()
  
  	return q
  }
docs: // NewTransferQueue builds a TransferQueue, direction and underlying mechanism determined by adapter