On Sun, Jun 19, 2016 at 9:38 PM, Carsten Haitzler <ras...@rasterman.com> wrote: > On Mon, 20 Jun 2016 00:35:35 -0300 Felipe Magno de Almeida > <felipe.m.alme...@gmail.com> said: >> On Mon, Jun 20, 2016 at 12:06 AM, Carsten Haitzler <ras...@rasterman.com> >> wrote: >> > On Sun, 19 Jun 2016 21:04:59 -0300 Felipe Magno de Almeida >> > <felipe.m.alme...@gmail.com> said: >> > >> >> On Sun, Jun 19, 2016 at 7:22 PM, Carsten Haitzler <ras...@rasterman.com> >> >> wrote: >> >> > On Sun, 19 Jun 2016 14:21:28 -0300 Felipe Magno de Almeida >> >> > <felipe.m.alme...@gmail.com> said: >> >> [snip] >> >> >> There will be wait. I'll implement it. It will throw an exception if it is >> >> called from the mainloop thread. And people will miss cancel if they >> >> don't look for it. They will miss it too if they use Eo_Promise too and >> >> don't look for it. >> > >> > there';s a difference. if it's a std promise then they expect it to work a >> > certain way. if its an efl one they need to learn its api and behaviour. >> > they will find the features. >> >> We can't be arguing C++ API because users won't read a header file. >> This is not reasonable. Do we expect C developers to read >> documentation, or at least doxygen docs? > > we do expect them to read. though in my experience few actually read a header > file. docs is an expectation. > > but the issue here is of masquerading with a feature that will never work > (wait). it'll always cause an exception. it'd just be best to look similar to > a > future/promise and just be a different class.
I don't understand why you think we can't implement wait. The C++ standard doesn't expect it to work with a mainloop, but from another thread. So it is very simple to implement it. When you instanciate a promise, you do also create a mutex, a cond and add a first then/cancel couple that will just take that mutex, set the value and broadcast on the cond. The future itself when instanciated will ref count the promise and on the wait will take the mutex and wait on the cond if the value is not there already. The only difference is that use of wait in C++ will lead to dead lock if you use it in the same thread, we will have a warning and throw an excepion in that case. This is the only difference and I fail to see where you see a problem. -- Cedric BAIL ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://sdm.link/zohomanageengine _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel