         }
     }
     
+    /// 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 stopAndCancel() {
        stop()
        cancelTasks()

        }
    }
    
    /// Stops the pipeline from starting any new tasks, until the next time you ask it to start. Tasks that were already running are unaffected by this.
    public func stop() {
        _internalQueue.async {
            self.isRunning = false
        }
    }
    
    /// Ask all the currently executing tasks to cancel themselves and remove everything from the pipeline. The pipeline will still be running after this, ready to accept and start new tasks.
    public func cancelTasks() {
        _internalQueue.async {
            for task in self._runningTasks {
