Re: [Vala] [Async] why use .begin ?



On Sat, 2009-09-19 at 01:41 +0200, Michael 'Mickey' Lauer wrote:
No, the call without .begin() is being deprecated.

From yestarday's discussion on IRC I understood it's not generally possible
to collapse to synchronous call automagically. Doing it involves running
a (recursive) main loop until the callback is called, but this brings a lot
of problems like something quitting the outer loop, the nested loops being
quit out of order and such. Therefore it should not be done without user's
explicit request.

I see, am I correct then in assuming that at the end of the day this means, 
calling an asynchronous function with out/return arguments is forbidden/will 
not work from synchronous code?

You can certainly call an asynchronous method with out/return values,
however, you obviously have to wait for the method to return until you
can use them. You could, for example, handle them in a closure used as
callback to .begin.

Jürg




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]