diff options
author | Cedric BAIL <cedric@osg.samsung.com> | 2018-11-22 17:11:54 -0800 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2018-11-30 14:58:14 -0800 |
commit | 31eab2cff96d5bca6dc27c4ad720c07ac8dbab4d (patch) | |
tree | ab3f77876440eb240c56bd919ba091b63895d803 /src/lib | |
parent | cc801e2e2aa625d282e60073eba17faa750e1f3c (diff) | |
download | efl-31eab2cff96d5bca6dc27c4ad720c07ac8dbab4d.tar.gz |
ecore: add an helper on Efl.Loop_Consumer to build resolved and rejected future more easily.
This make all object that inherit from Efl.Loop_Consumer have an easy ability to create a future
from their link to a loop provider. This way there is no need to further lookup for a scheduler.
This can by applied after the patch series from T7471.
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7337
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/ecore/efl_loop_consumer.c | 14 | ||||
-rw-r--r-- | src/lib/ecore/efl_loop_consumer.eo | 12 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/ecore/efl_loop_consumer.c b/src/lib/ecore/efl_loop_consumer.c index 795b5fcfd0..29e94ed52d 100644 --- a/src/lib/ecore/efl_loop_consumer.c +++ b/src/lib/ecore/efl_loop_consumer.c @@ -36,4 +36,18 @@ _efl_loop_consumer_efl_object_parent_set(Eo *obj, Efl_Loop_Consumer_Data *pd EIN efl_parent_set(efl_super(obj, EFL_LOOP_CONSUMER_CLASS), parent); } +static Eina_Future * +_efl_loop_consumer_future_resolved(Eo *obj, Efl_Loop_Consumer_Data *pd EINA_UNUSED, + Eina_Value result) +{ + return eina_future_resolved(efl_loop_future_scheduler_get(obj), result); +} + +static Eina_Future * +_efl_loop_consumer_future_rejected(Eo *obj, Efl_Loop_Consumer_Data *pd EINA_UNUSED, + Eina_Error error) +{ + return eina_future_rejected(efl_loop_future_scheduler_get(obj), error); +} + #include "efl_loop_consumer.eo.c" diff --git a/src/lib/ecore/efl_loop_consumer.eo b/src/lib/ecore/efl_loop_consumer.eo index e486567ed5..4d7484e13c 100644 --- a/src/lib/ecore/efl_loop_consumer.eo +++ b/src/lib/ecore/efl_loop_consumer.eo @@ -14,6 +14,18 @@ class Efl.Loop_Consumer (Efl.Object) loop: Efl.Loop; [[Efl loop]] } } + future_resolved { + params { + result: any_value; + } + return: future<any_value>; + } + future_rejected { + params { + error: Eina.Error; + } + return: future<Eina.Error>; + } } implements { Efl.Object.parent { set; } |