-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Labels
Description
Since we are talking "Bluebird" I wonder how hard it would be to implement Promise.prop from bluebird. I would envision this to operate similarly to QPromise::all but it would take a map instead of a sequence. I am not sure how this would translate since we cannot construct classes in C++, but what if we just used a QMap<QString, T>? An example of how this might look would be:
QMap<QString, QPromise<QByteArray>> servers({
{"a", download(QUrl("http://a..."))},
{"b", download(QUrl("http://b..."))},
{"c", download(QUrl("http://c..."))}
});
QPromise::prop(servers)
.then([](QMap<QString, QByteArray> res) {
qDebug() << res["a"] << res["b"] << res["c"];
});aol-nnov