Ah, thanks. Now I see why I am confused - in my understanding Task is something more similar to std::function in terms that it it something that can be stored and executed (somehow) later. E.g. instead of doing something like auto future = QtConcurrent::run(foo, value1, value2); We do auto task = QtTasks::createTask(foo, value1, value2); // do stuff auto future = QtConcurrent::run(task);
I do not see why cancellation/progress reporting makes QFuture «not a future» - it’s simply an interface to an async execution. Stored function call is something different, on the other hand. Can you also elaborate what do you mean by «reusability»? Ability to do something like future.restart(); ? > 1 февр. 2020 г., в 14:44, Sona Kurazyan <[email protected]> написал(а): > > In my understanding a future represents a single result of a computation > which will be available sometime in future, it doesn’t assume reusability, > progress reporting, etc. If you take a look to other implementations of a > future (like boost::future, folly::future or std::experimental::future), none > of them has this “extra” functionality similar to QFuture, none of them > represents a set of results as QFuture does. This may be confusing for people > who are expecting QFuture to be a typical future they are used to, and I > actually saw some complains about that. > > Best regards, > Sona > > > From: Иван Комиссаров <[email protected]> > Sent: Saturday, February 1, 2020 1:56 PM > To: Sona Kurazyan <[email protected]> > Cc: [email protected] > Subject: Re: [Development] Make a decision for asynchronous APIs > > Can you please elaborate the difference? > > > 31 янв. 2020 г., в 17:24, Sona Kurazyan <[email protected] > <mailto:[email protected]>> написал(а): > > Additionally, there are some discussions about QFuture being a mix between a > “Task” and a “Future”. One of the options of improving this situation is to > make a QTask (or QJob) out of the current QFuture. But then the question is: > should we also support a “classic” QFuture? Is there a value in having it, > when there are already some very advanced implementations of a future?
_______________________________________________ Development mailing list [email protected] https://lists.qt-project.org/listinfo/development
