On Wed, 8 Jun 2016 10:07:33 -0700 Cedric BAIL <cedric.b...@free.fr> said:
> On Wed, Jun 8, 2016 at 8:10 AM, <marcel-hollerb...@t-online.de> wrote: > > On Wed, Jun 08, 2016 at 08:16:20PM +0900, Carsten Haitzler wrote: > >> > > [...] > >> they should be eo objects. > > > > I wondered in the beginning why promises are not a eo object, comparing the > > two models shows that it can be dangerous moving promises to a Eo.Base > > class. > > > > Take a look at the events, when in a promise the then callback is > > called the callback is unsubscribed, and never called again. When a then > > callback is attached after the value is set the then callback is called > > while beeing added. So this is a completly different sematic compared to > > Eo.Base. Of course a implementation can be treated to do smth. like > > that, but i think its confusing to users of a api, if objects behave > > differently under the same base api. > > > > Also when attaching a then_cb you will get a ref of the promise, so as > > long as your then_cb is not called the promise will not be freed. This > > is also something which does not play with the ref/unref system of > > Eo.Base. > > > > Basically you can say, after the then_cb you just have to nuke your > > reference to your promise, at the best dont keep a reference to it. > > > > So all in all the concept of A Promise inheriting from Eo.Base doesnt > > sound sane to me, and looks like a huge confusion you can get in. So I > > would prefer to keep the promises as they are, exept the idea of using > > Eo_Id to make the pointer more secure. > > Good point. It should have been a generic infrastructure anyway. Will > work on that. Don't do this.. because it shouldn't! promises should be eo objects! don't go duplicating this in eina just because you can't see that eina promises are objects. -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ras...@rasterman.com ------------------------------------------------------------------------------ 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. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel