Hi folks,

I was struggling a bit with the right approach to get return values from
async methods if called from a sync method. The approach would be to
register a callback in a closure like:

public string [] get_results () {
        string [] results = {};
        some_async_method.begin (parameters, (obj, res) => {
                results = some_async_method.end (res);
        });
        
        return results;
}

as obviously some_async_method is not finished yet, I'm getting an empty
results array. 
How do I make sure that the results are properly returned after the the
async method has finished?

thanks,

-- 
tomw <[email protected]>

_______________________________________________
vala-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to