Function

DexFutureCallback

Declaration

DexFuture*
FutureCallback (
  DexFuture* future,
  gpointer user_data
)

Description [src]

A DexFutureCallback can be executed from a DexBlock as response to another DexFuture resolving or rejecting.

The callback will be executed within the scheduler environment the block is created within when using dex_future_then(), dex_future_catch(), dex_future_finally(), dex_future_all(), and similar functions.

This is the expected way to handle completion of a future when not using DexFiber via dex_scheduler_spawn().

Parameters

future DexFuture
 

A resolved or rejected DexFuture.

 The data is owned by the caller of the function.
user_data gpointer
 

Closure data associated with the callback.

Return value

Returns: DexFuture
 

A DexFuture or NULL.

 The caller of the function takes ownership of the data, and is responsible for freeing it.
 The return value can be NULL.