Data Structures | Macros | Typedefs | Functions | Variables
Efl future and promise.

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_Classefl_future_class_get (void)
 
EOAPI Efl_Futureefl_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...
 

Detailed Description

Function Documentation

◆ efl_future_class_get()

EWAPI const Efl_Class* efl_future_class_get ( void  )
Since
1.19

◆ efl_future_then()

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.

Parameters
[in]successthe callback to call in case of a succesful computation from the promise
[in]failurethe callback to call in case of a failure to deliver from the promise
[in]progressthe callback to call during the progression of the the promise, this is optional
[in]dataadditional data to pass to the callback
Returns
Return a new future when the callback has been successfully added pointing to the next request being processed during the future success, failure or progress callback (You can reference count the next promise to defer the result and make it asynchronous too. This future can be ignored.
Note
except if you do reference count the Efl.Future object, you can only call once this function.

Referenced by elm_fileselector_button_path_set(), and elm_fileselector_entry_path_set().

◆ efl_future_cancel()

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.

See also
efl_future_use
Since
1.19

◆ efl_future_use()

static void efl_future_use ( Efl_Future **  storage,
Eo future 
)
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.

Parameters
[out]storageWill be set to obj and tracked during all the lifetime of the future.
[in]futureThe future to remember about.
See also
efl_future_cancel

References efl_wref_add().

Variable Documentation

◆ EINA_ERROR_FUTURE_CANCEL [1/2]

Eina_Error EINA_ERROR_FUTURE_CANCEL

The error identifier corresponding to a future being canceled.

Since
1.19

◆ EINA_ERROR_FUTURE_CANCEL [2/2]

EINA_ERROR_FUTURE_CANCEL

The error identifier corresponding to a future being canceled.

Since
1.19