FutureCallback


Description:

[ CCode ( instance_pos = 1.9 ) ]
public delegate Future? FutureCallback (Future future)

A `DexFutureCallback` can be executed from a [class@Dex.

Block] as response to another [class@Dex.Future] resolving or rejecting.

The callback will be executed within the scheduler environment the block is created within when using [ctor@Dex.Future.then], [ ctor@Dex.Future.catch] [ctor@Dex.Future.finally], [ctor@Dex.Future.all], and similar functions.

This is the expected way to handle completion of a future when not using [class@Dex.Fiber] via [method@Dex.Scheduler.spawn].

Parameters:

future

a resolved or rejected [class@Dex.Future]

user_data

closure data associated with the callback

Returns:

a [class@Dex.Future] or null


Namespace: Dex
Package: libdex-1