eina: Fix futures for new core loop

This commit is contained in:
Andy Williams 2017-12-21 16:00:29 +00:00
parent 373a89a421
commit 6a31dd60db
1 changed files with 4 additions and 4 deletions

View File

@ -90,7 +90,7 @@ _delayed_value_reject(void *data, const Eina_Value value EINA_UNUSED)
Eina_Promise *promise;
promise = (Eina_Promise *)data;
eina_promise_reject(promise, EINA_ERROR_MAGIC_FAILED);
eina_promise_reject(promise, EINA_ERROR_NOT_IMPLEMENTED);
return EINA_VALUE_EMPTY;
}
@ -113,7 +113,7 @@ _failed_future()
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
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);
}
@ -169,7 +169,7 @@ _delayed_int_future_get(double delay)
promise = eina_promise_new(efl_loop_future_scheduler_get(loop),
_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_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK,
_timeout, promise));
@ -219,7 +219,7 @@ _exit_cb(void *data EINA_UNUSED, const Eina_Value v EINA_UNUSED,
static 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),
{.cb = _chain_multiply_cb, .data = NULL},
eina_future_cb_console(" Multiplied by 2: ", NULL),