On Thu, 29 Sep 2016 12:57:24 -0300 Felipe Magno de Almeida <[email protected]> said:
> On Thu, Sep 29, 2016 at 12:38 PM, Davide Andreoli > <[email protected]> wrote: > > I'm starting this new thread to further discuss promises, thus the tag > > [YetAnotherPromiseThread] :) > > [snip] > > > The topic here is: do we really want to allow instant resolution of > > promises? > > For "instant resolution" I mean a promise that will call the user callbacks > > as soon as the callbacks are "connected", thus in the middle of the user > > code. (we took as an example a cached promise value) > > I think the fulfillment must happen immediatelly and the user > of the promise must be able to value_set/fail immediatelly. > However, as raster has mentioned some place else, the callback > call could be delayed to the next event loop idler or job, so > the callback is not called directly from efl_promise_then. > > I'm not sure what cedric has implemented, but both cases are valid > IMO. However, calling from the next event loop job/idler is a lot > easier to reason about it, so I'm inclined to like it better. however you slice and dice it, *IF* we called immediately and didnt defer we'd break JS promise rules in our JS bindings, thus basically our JS bindings are broken by DESIGN of the core lib. so either: 1. don't use/expose promises at all in js - then we don't have to follow their rules and/or 2. defer always even if it's just a job to do the defer (it's still called before mainloop is done and goes idle - thus before rendering starts). > [snip] > > Regards, > -- > Felipe Magno de Almeida > > ------------------------------------------------------------------------------ > _______________________________________________ > enlightenment-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) [email protected] ------------------------------------------------------------------------------ _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
