eina: Fix futures for new core loop
This commit is contained in:
parent
373a89a421
commit
6a31dd60db
|
@ -90,7 +90,7 @@ _delayed_value_reject(void *data, const Eina_Value value EINA_UNUSED)
|
||||||
Eina_Promise *promise;
|
Eina_Promise *promise;
|
||||||
|
|
||||||
promise = (Eina_Promise *)data;
|
promise = (Eina_Promise *)data;
|
||||||
eina_promise_reject(promise, EINA_ERROR_MAGIC_FAILED);
|
eina_promise_reject(promise, EINA_ERROR_NOT_IMPLEMENTED);
|
||||||
|
|
||||||
return EINA_VALUE_EMPTY;
|
return EINA_VALUE_EMPTY;
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ _failed_future()
|
||||||
eina_future_then_easy(eina_future_new(promise), .error = _error_print);
|
eina_future_then_easy(eina_future_new(promise), .error = _error_print);
|
||||||
|
|
||||||
// This future is basically a timer - wait 100ms and then resolve the promise above
|
// This future is basically a timer - wait 100ms and then resolve the promise above
|
||||||
eina_future_then_easy(efl_loop_timeout(efl_loop_main_get(EFL_LOOP_CLASS), 0.1),
|
eina_future_then_easy(efl_loop_timeout(efl_loop_main_get(EFL_LOOP_CLASS), 0.2),
|
||||||
.success = _delayed_value_reject, .data = promise);
|
.success = _delayed_value_reject, .data = promise);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ _delayed_int_future_get(double delay)
|
||||||
promise = eina_promise_new(efl_loop_future_scheduler_get(loop),
|
promise = eina_promise_new(efl_loop_future_scheduler_get(loop),
|
||||||
_promise_cancel, NULL);
|
_promise_cancel, NULL);
|
||||||
|
|
||||||
efl_add(EFL_LOOP_TIMER_CLASS, NULL,
|
efl_add(EFL_LOOP_TIMER_CLASS, loop,
|
||||||
efl_loop_timer_interval_set(efl_added, delay),
|
efl_loop_timer_interval_set(efl_added, delay),
|
||||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK,
|
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK,
|
||||||
_timeout, promise));
|
_timeout, promise));
|
||||||
|
@ -219,7 +219,7 @@ _exit_cb(void *data EINA_UNUSED, const Eina_Value v EINA_UNUSED,
|
||||||
static void
|
static void
|
||||||
_chained_future(void)
|
_chained_future(void)
|
||||||
{
|
{
|
||||||
eina_future_chain(_delayed_int_future_get(0.1),
|
eina_future_chain(_delayed_int_future_get(0.5),
|
||||||
eina_future_cb_console("Starting chain with: ", NULL),
|
eina_future_cb_console("Starting chain with: ", NULL),
|
||||||
{.cb = _chain_multiply_cb, .data = NULL},
|
{.cb = _chain_multiply_cb, .data = NULL},
|
||||||
eina_future_cb_console(" Multiplied by 2: ", NULL),
|
eina_future_cb_console(" Multiplied by 2: ", NULL),
|
||||||
|
|
Loading…
Reference in New Issue