[Vala] Combining async methods with external processes



Hello,

I want to perform a series of tasks one after the other, but in the
background. So I have:

async bool perform_tasks () {
    bool result = yield task1 ();
    if (result)
        result = yield task2 ();
    if (result)
        result = yield task3 ();

    Idle.add (perform_tasks.callback)
    yield;
    return result;
}

more or less.

One of the tasks however spawns a new process, and I'm not sure how
the callback from this process is supposed to fit into Vala's way of
doing async programming, i.e. Process.spawn_async_with_pipes () isn't
actually an "async" method.

How would I do this, am I making things too complicated?

Cheers,
James



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