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

Add support for combining QFutures together

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes