Re: [Vala] Questions on async functions



Nor Jaidi Tuah píše v St 03. 02. 2010 v 09:36 +0800:
Q1.
What is the recommended way of aborting an
async function so that another invocation can
be made only after the previous one has
stopped, thus ensuring that there is at most
one invocation at any time?


I think I don't fully understand the question here. You can simply add
the invocations into another async method, thus chaining them one after
another. Isn't that what you mean?

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.


Attachment: signature.asc
Description: Toto je digitálně podepsaná část zprávy



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