Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-86728

Add support for combining QFutures together

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.0
    • Core: QtConcurrent
    • None

      For many tasks, multiple concurrent pipelines are needed to complete the task. There's no easy way to combine multiple QFuture together. For example:

      QFuture<int> pipeline1 = QtConcurrent::run([]() { return 1; });
      QFuture<QString> pipeline2 = QtConcurrent::run([]() { return "Hello world"; });
      
      //Proposed API to combine multiple futures together
      QFuture<void> combinePipelines = QFuture::combine({pipeline1, pipeline2});
      
      combinePipeline.then([pipeline1, pipeline2]() {
          //Should print out "Results: 1 Hello World"
          qDebug() << "Result:" << pipeline1.result() + pipeline2.result();
      });

      This functionality is supported by AsyncFuture library.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            sonakur Sona Kurazyan
            pschuchardt Philip Schuchardt
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes