forked from enlightenment/efl
ecore_con: simplify code by using proper helper.
efl_loop_promise_new is a helper function that does automatically figure out an available scheduler and create a promise from it. Basically replacing the call to eina_promise_new(efl_loop_future_scheduler_get(o), ...). Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D7333
This commit is contained in:
parent
98b716d0fa
commit
bf445d2476
|
@ -773,8 +773,7 @@ _efl_net_control_access_point_connect(Eo *o, Efl_Net_Control_Access_Point_Data *
|
||||||
Eina_Promise *promise;
|
Eina_Promise *promise;
|
||||||
Eina_Future *f = NULL;
|
Eina_Future *f = NULL;
|
||||||
|
|
||||||
promise = eina_promise_new(efl_loop_future_scheduler_get(o),
|
promise = efl_loop_promise_new(o, _efl_net_control_access_point_connect_promise_del, o);
|
||||||
_efl_net_control_access_point_connect_promise_del, o);
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(promise, NULL);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(promise, NULL);
|
||||||
|
|
||||||
f = eina_future_new(promise);
|
f = eina_future_new(promise);
|
||||||
|
|
|
@ -399,8 +399,7 @@ _efl_net_control_technology_scan(Eo *o, Efl_Net_Control_Technology_Data *pd)
|
||||||
Eina_Promise *promise;
|
Eina_Promise *promise;
|
||||||
Eina_Future *f = NULL;
|
Eina_Future *f = NULL;
|
||||||
|
|
||||||
promise = eina_promise_new(efl_loop_future_scheduler_get(o),
|
promise = efl_loop_promise_new(o, _efl_net_control_technology_scan_promise_del, NULL);
|
||||||
_efl_net_control_technology_scan_promise_del, NULL);
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(promise, NULL);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(promise, NULL);
|
||||||
|
|
||||||
f = eina_future_new(promise);
|
f = eina_future_new(promise);
|
||||||
|
|
|
@ -572,7 +572,7 @@ _efl_net_ip_address_resolve(Eo *cls EINA_UNUSED, void *pd EINA_UNUSED, const cha
|
||||||
ctx->thread = efl_net_ip_resolve_async_new(host, port, &hints, _efl_net_ip_address_resolve_done, ctx);
|
ctx->thread = efl_net_ip_resolve_async_new(host, port, &hints, _efl_net_ip_address_resolve_done, ctx);
|
||||||
EINA_SAFETY_ON_NULL_GOTO(ctx->thread, error_thread);
|
EINA_SAFETY_ON_NULL_GOTO(ctx->thread, error_thread);
|
||||||
|
|
||||||
ctx->promise = eina_promise_new(efl_loop_future_scheduler_get(efl_main_loop_get()), _efl_net_ip_address_resolve_del, ctx);
|
ctx->promise = efl_loop_promise_new(efl_main_loop_get(), _efl_net_ip_address_resolve_del, ctx);
|
||||||
EINA_SAFETY_ON_NULL_GOTO(ctx->promise, error_promise);
|
EINA_SAFETY_ON_NULL_GOTO(ctx->promise, error_promise);
|
||||||
|
|
||||||
free(str);
|
free(str);
|
||||||
|
|
Loading…
Reference in New Issue