Page MenuHomePhabricator

Asynchronous create function in Efl.Ui.Factory
Closed, ResolvedPublic

Description

Having Efl.Ui.Factory.create be synchronous is not powerful enough for all our use case. We need it to become asynchronous. Proposed prototype would be to simply return a future<Efl.Gfx.Entity>. Need to adjust current view to work with it.

cedric created this task.Fri, Nov 16, 11:39 AM
cedric triaged this task as High priority.

is it event or function?
fac.create() is function which will create an class instance directly,
Create_Event will be a event which will be called when factory create an class instace.
so the T7473 and this Task talking about same thing or different one?
I little bit confusing here :)

I think it should still be a function. future<Efl.Gfx.Entity> efl.factory.create(...) replacing the current create function. As the factory is the one building widgets, it has to do it at the right time. And the factory is also the only one that know what data are mandatory to create a widget and which one can wait for later.

about D7332,
mostly view will request some bunch of items in one request,
so it would be much nice to get series of them in single event or future, but I don't know how to do this.
maybe your current patch could be thing that we can do best.

Making the create function work for multiple items at a time will make it harder to implement I think. The factory will have to get property on a list/array of model in parallel and wait for all of them to resolve. Then it will create the object and return them as an array of object. I don't think there is much gain to try to pack this at this point. Maybe later when we start to have more important work load we can start to look at where we do spend our time and reduce the calls that create problem.

cedric closed this task as Resolved.Fri, Dec 7, 10:05 AM

This has actually landed.