Data Structures | |
struct | _Efl_Future_Event_Failure |
struct | _Efl_Future_Event_Success |
struct | _Efl_Future_Event_Progress |
Macros | |
#define | _EFL_PROMISE_EO_CLASS_TYPE |
#define | EFL_FUTURE_CLASS efl_future_class_get() |
#define | EFL_FUTURE_EVENT_FAILURE (&(_EFL_FUTURE_EVENT_FAILURE)) |
A future failed. | |
#define | EFL_FUTURE_EVENT_SUCCESS (&(_EFL_FUTURE_EVENT_SUCCESS)) |
A future succeeded. | |
#define | EFL_FUTURE_EVENT_PROGRESS (&(_EFL_FUTURE_EVENT_PROGRESS)) |
A future progressed. | |
Typedefs | |
typedef Eo | Efl_Promise |
typedef struct _Efl_Future_Event_Failure | Efl_Future_Event_Failure |
Parameter passed in event callbacks in case of future failure to proceed. | |
typedef struct _Efl_Future_Event_Success | Efl_Future_Event_Success |
Parameter passed in event callbacks in case of future succeeding to proceed. | |
typedef struct _Efl_Future_Event_Progress | Efl_Future_Event_Progress |
Parameter passed in event callbacks while a future is progressing a request. | |
typedef Eo | Efl_Promise |
The type of Efl Promise used in asynchronous operation, the write side of a promise. | |
Functions | |
EWAPI const Efl_Class * | efl_future_class_get (void) |
EOAPI Efl_Future * | efl_future_then (Eo *obj, Efl_Event_Cb success, Efl_Event_Cb failure, Efl_Event_Cb progress, const void *data) |
Add sets of callbacks to handle the progress and the result of a future. More... | |
EOAPI void | efl_future_cancel (Eo *obj) |
Cancel the need for that specific future. More... | |
static void | efl_future_use (Efl_Future **storage, Eo *future) |
To be used in conjunction with when you plan to use efl_future_cancel. More... | |
Variables | |
Eina_Error | EINA_ERROR_FUTURE_CANCEL |
The error identifier corresponding to a future being canceled. More... | |
EOAPI const Efl_Event_Description | _EFL_FUTURE_EVENT_FAILURE |
EOAPI const Efl_Event_Description | _EFL_FUTURE_EVENT_SUCCESS |
EOAPI const Efl_Event_Description | _EFL_FUTURE_EVENT_PROGRESS |
EAPI Eina_Error | EINA_ERROR_FUTURE_CANCEL |
The error identifier corresponding to a future being canceled. More... | |
EWAPI const Efl_Class* efl_future_class_get | ( | void | ) |
EOAPI Efl_Future* efl_future_then | ( | Eo * | obj, |
Efl_Event_Cb | success, | ||
Efl_Event_Cb | failure, | ||
Efl_Event_Cb | progress, | ||
const void * | data | ||
) |
Add sets of callbacks to handle the progress and the result of a future.
callbacks are called depending on the outcome of the promise related to the future.
[in] | success | the callback to call in case of a succesful computation from the promise |
[in] | failure | the callback to call in case of a failure to deliver from the promise |
[in] | progress | the callback to call during the progression of the the promise, this is optional |
[in] | data | additional data to pass to the callback |
EOAPI void efl_future_cancel | ( | Eo * | obj | ) |
Cancel the need for that specific future.
This will trigger the failure of the future and may result in the promise stopping its computation as it will be notified when there is no more need for computing the request.
|
inlinestatic |
To be used in conjunction with when you plan to use efl_future_cancel.
This function will store in *wref, obj and make sure that on failure or success of the future, it will be reset to NULL. This guarantee that the pointer you are using will always be correct and that you do not have to worry about passing a dead pointer to efl_future_cancel.
[out] | storage | Will be set to obj and tracked during all the lifetime of the future. |
[in] | future | The future to remember about. |
References efl_wref_add().
Eina_Error EINA_ERROR_FUTURE_CANCEL |
The error identifier corresponding to a future being canceled.
EINA_ERROR_FUTURE_CANCEL |
The error identifier corresponding to a future being canceled.