docs: def run_parallel_with_display(wf, n_threads, display):
      """Adds a display to the parallel runner. Because messages come in
      asynchronously now, we start an extra thread just for the display
      routine."""
      LogQ = Queue()
  
      S = Scheduler(error_handler=display.error_handler)
  
      threading.Thread(
          target=patch,
          args=(LogQ.source, sink_map(display)),
          daemon=True).start()
  
      W = Queue() \
          >> branch(log_job_start >> LogQ.sink) \
          >> thread_pool(*repeat(worker, n_threads)) \
          >> branch(LogQ.sink)
  
      result = S.run(W, get_workflow(wf))
      LogQ.wait()
  
      return result