RFC: "modernization" of service proxy API



Hi,

Currently we have the following family of APIs to do service proxy calls (omitting the deprecated _hash() calls)

gupnp_service_proxy_begin_action
gupnp_service_proxy_begin_action_list
gupnp_service_proxy_cancel_action
gupnp_service_proxy_end_action
gupnp_service_proxy_end_action_hash
gupnp_service_proxy_end_action_list
gupnp_service_proxy_send_action
gupnp_service_proxy_send_action_list

Especially the send functions are bad because they run a nested event loop.

I would like to deprecate those and replace it with the following, more GIO-ish approach:

// Create the action
action = gupnp_service_proxy_action_new ("SomeAction", "arg1", G_TYPE_STRING, arg1, NULL);

// or
action = gupnp_service_proxy_action_new_from_list ("SomeAction", in_names, in_values);

// Sync call
success = gupnp_service_proxy_call_action (proxy, action, cancellable, &error);

// Async call
gupnp_service_proxy_call_action_async (proxy, action, cancellable, callback);
action = gupnp_service_proxy_call_action_finish (proxy, result, error);

// Retrieving the arguments
gupnp_service_proxy_action_get_result (action, "out1", G_TYPE_STRING, &out1, NULL);
gupnp_service_proxy_action_get_result_hash (action, &hash);
gupnp_service_proxy_action_get_result_lists (action, &out_names, &out_values);

Any Thoughts?


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