Re: [Development] QFutureInterface

2015-12-11 Thread Bauer, Christian
Hi, Sorry for the delay. > Yes, please provide a short example with std::promise, which, afaiu, works > for your use-case. Below is a simplified example where a client calls an API function that blocks until the result is actually available. The request is sent to a queue, where a "server"

Re: [Development] QFutureInterface

2015-12-04 Thread Marc Mutz
On Friday 27 November 2015 13:45:28 Bauer, Christian wrote: > Hi Marc, > > > You should be able to develop a QPromise/QPackagedTask with the current > > QFutureInterface already. At least as long as it's attached to some > > > QThreadPool. > > What, exactly, are you trying to do that requires a

Re: [Development] QFutureInterface

2015-12-04 Thread Bauer, Christian
Hi Marc, First: thanks for your suggestions. > 1. Inherit your runnable from QRunnable and QFutureInterface >In the ctor, call QFI::setRunnable(this). >2. Create an instance of your runnable, call runnable.future() to get the >QFuture end > 3. Schedule the runnable on a thread pool (cf.

Re: [Development] QFutureInterface

2015-12-04 Thread Marc Mutz
On Friday 04 December 2015 10:49:04 Bauer, Christian wrote: > I could provide a code example if this helps... Yes, please provide a short example with std::promise, which, afaiu, works for your use-case. Thanks, Marc -- Marc Mutz | Senior Software Engineer KDAB

Re: [Development] QFutureInterface

2015-12-03 Thread Alejandro Exojo
El Friday 27 November 2015, Bauer, Christian escribió: > Our (simplified) problem is: this function does not return a value but > feeds an asynchronous pipeline. When the pipeline processing is done it > will call promise.SetResult(); promise.reportResult(); > and only then the future should be

Re: [Development] QFutureInterface

2015-11-27 Thread Bauer, Christian
Hi Marc, > You should be able to develop a QPromise/QPackagedTask with the current > QFutureInterface already. > At least as long as it's attached to some > QThreadPool. > What, exactly, are you trying to do that requires a patch to QFI? I am not aware of any QPackagedTask in Qt, only of

Re: [Development] QFutureInterface

2015-11-26 Thread Bauer, Christian
Hello, There was a discussion about the "internal" class QFutureInterface a few months ago on this list [1] about making QFuture/QFutureInterface more like std::future/std::promise in C++11. It seems this is not going to happen before Qt 6. We have a use case for a promise though and the

Re: [Development] QFutureInterface

2015-11-26 Thread Marc Mutz
Hi Christian, On Thursday 26 November 2015 11:50:10 Bauer, Christian wrote: > Hello, > > There was a discussion about the "internal" class QFutureInterface a few > months ago on this list [1] about making QFuture/QFutureInterface more > like std::future/std::promise in C++11. It seems this is