-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
None
-
6.0
-
None
-
-
8
-
Team A Foundation Sprint 55
When creating a Async pipeline sometimes QFuture.then() may return QFuture. It's useful to unwrap the returned QFuture such there's not QFuture<QFuture<T>>. For example:
auto download = [](QUrl url) {
...
return QList<Tile>({tile1, ..., tileX});
}
auto processTiles = [](QList<Tile> tiles) {
QFuture<QImage> future = QtConcurrent::mappedReduced(tiles,
processTile, //Map function
reduceTiles) //Reduce function
return future;
}
auto saveImage = [](QImage image) {
image.save(...);
}
auto future = QtConcurrent::run(download, url)
.then(processTiles)
.then(saveImage)
Things to consider when implementing unwrapped QFutures this:
- Handling / propagating progress
- Handling errors
- Handling canceling and pausingĀ