Re: [Vala] Questions on async functions




Q2.
Any hope of getting the following replaced
with a better syntax? :-)

   Idle.add(async_function.callback);
   yield;

Why not simply:

   yield;

?


Because 'yield' just stops the method until the callback resumes it. It
does nothing else. You can for example wait for a signal this way.
Resuming in an idle callback is just one of the possibilities.

Why not

yield Idle;

or even

yield until Idle;
                                          


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