You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use GDbus with lgi but I have some issue. When I try to do a synchronous call it works fine (remove the 3 last arguments from the example below and use call_sync and it will work as expected). However, I cannot find a way to extract SimpleAsyncResult results. Most methods seems to be there but the only useful one. I was wondering if I missed something or it just required unimplemented and/or undocumented hacks to get the result.
I don't think that you need or should use SImpleAsyncResult, because it is intended to use when implementing asynchronous API, not when you are using it. You should use appropriate _finish() method to retrieve call result. Following modification of your callback argument makes this work:
function(conn, res)
localret, err=bus:call_finish(res)
print(ret, err)
end
Please check giostreams.lua sample distributed with lgi to see possible ways how to deal with Gio async API, particularly Gio.Async could be useful. Your example rewritten in Gio.Async looks like this:
Hi,
I try to use GDbus with lgi but I have some issue. When I try to do a synchronous call it works fine (remove the 3 last arguments from the example below and use
call_sync
and it will work as expected). However, I cannot find a way to extract SimpleAsyncResult results. Most methods seems to be there but the only useful one. I was wondering if I missed something or it just required unimplemented and/or undocumented hacks to get the result.Here is a semi working example:
I failed to find a way to get tge boolean back. C examples use
set_op_res_gpointer
, but it doesn't seem to exist in LGIThanks
The text was updated successfully, but these errors were encountered: