         }
     }
     
+    /// Add multiple tasks to the pipeline. If the pipeline is running then the task will be started asap, depending on maxConcurrentTasks
     public func addTasks(_ tasks: [Task]) {
         _internalQueue.async {
             self._pendingTasks.append(contentsOf: tasks)

        }
    }
    
    public func stop() {
        _internalQueue.async {
            self.isRunning = false
        }
    }
    
    public func cancelTasks() {
        _internalQueue.async {
            for task in self._runningTasks {

        }
    }
    
    /// Stop the pipeline and also cancel/clear out all the running and pending tasks.
    public func stopAndCancel() {
        stop()
        cancelTasks()
