Re: [Vala] [Async] why use .begin ?
- From: Jürg Billeter <j bitron ch>
- To: Michael 'Mickey' Lauer <mickey vanille-media de>
- Cc: vala-list gnome org
- Subject: Re: [Vala] [Async] why use .begin ?
- Date: Sat, 19 Sep 2009 02:57:19 +0200
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]