cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=31eab2cff96d5bca6dc27c4ad720c07ac8dbab4d

commit 31eab2cff96d5bca6dc27c4ad720c07ac8dbab4d
Author: Cedric BAIL <[email protected]>
Date:   Thu Nov 22 17:11:54 2018 -0800

    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 <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D7337
---
 src/lib/ecore/efl_loop_consumer.c  | 14 ++++++++++++++
 src/lib/ecore/efl_loop_consumer.eo | 12 ++++++++++++
 2 files changed, 26 insertions(+)

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; }

-- 


Reply via email to