summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-09-12 14:08:40 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-09-12 14:08:40 -0700
commitde106a29733daf398d318eae2aa6e1c1c8581970 (patch)
treeda1579f732eda12d51f319cbc002a2d6c8e16791
parent2e4d357a26950864f6edf03c3b664fcad8b0d036 (diff)
downloadefl-de106a29733daf398d318eae2aa6e1c1c8581970.tar.gz
eio: move efl.io.manager.close to use the new future.
-rw-r--r--src/lib/eio/efl_io_manager.c21
-rw-r--r--src/lib/eio/efl_io_manager.eo2
2 files changed, 12 insertions, 11 deletions
diff --git a/src/lib/eio/efl_io_manager.c b/src/lib/eio/efl_io_manager.c
index e4100810af..75fa2289b0 100644
--- a/src/lib/eio/efl_io_manager.c
+++ b/src/lib/eio/efl_io_manager.c
@@ -558,30 +558,31 @@ _efl_io_manager_open(Eo *obj,
return NULL;
}
-static Efl_Future *
+static Eina_Future *
_efl_io_manager_close(Eo *obj,
Efl_Io_Manager_Data *pd EINA_UNUSED,
Eina_File *file)
{
- Efl_Promise *p;
+ Eina_Promise *p;
+ Eina_Future *future;
Eio_File *h;
- Eo *loop = efl_loop_get(obj);
- p = efl_add(EFL_PROMISE_CLASS, loop);
+ p = eina_promise_new(efl_loop_future_scheduler_get(obj),
+ _efl_io_manager_future_cancel, NULL);
if (!p) return NULL;
+ future = eina_future_new(p);
h = eio_file_close(file,
- _file_done_cb,
- _file_error_cb,
+ _future_file_done_cb,
+ _future_file_error_cb,
p);
if (!h) goto end;
+ eina_promise_data_set(p, h);
- efl_event_callback_array_add(p, promise_handling(), h);
- return efl_promise_future_get(p);
+ return efl_future_Eina_FutureXXX_then(obj, future);
end:
- efl_del(p);
- return NULL;
+ return future;
}
#include "efl_io_manager.eo.c"
diff --git a/src/lib/eio/efl_io_manager.eo b/src/lib/eio/efl_io_manager.eo
index 34e70d985c..a4e8aaddc5 100644
--- a/src/lib/eio/efl_io_manager.eo
+++ b/src/lib/eio/efl_io_manager.eo
@@ -91,7 +91,7 @@ class Efl.Io.Manager (Efl.Loop_User)
@in file: ptr(Eina.File); [[Eina file handle]]
// Here we're just interested whether the promise was fullfilled or not. No value needed.
}
- return: future<int>; [[Close return code]]
+ return: own(ptr(Eina.Future)); [[Close return code]]
}
}
}