Future
Object Hierarchy:
Description:
[
CCode ( type_id =
"dex_future_get_type ()" ) ]
public class Future :
Object
`DexFuture` is the base class representing a future which may resolve with a value or reject with error at some point in the future.
It is the basis for libdex's concurrency and parallelism model.
Use futures to represent work in progress and allow consumers to build robust processing chains up front which will complete or fail as
futures resolve or reject.
When running on a [class@Dex.Fiber], you may use [method@Dex.Future.await] and similar functions to suspend the current thread and return
upon completion of the dependent future.
Content:
Creation methods:
- protected Future ()
- public Future.all_racev (Future[] futures)
Creates a new [class@Dex.
- public Future.allv (Future[] futures)
Creates a new [class@Dex.
- public Future.anyv (Future[] futures)
Creates a new [class@Dex.
- public Future.catch (owned Future future, owned FutureCallback callback)
Calls callback when future rejects.
- public Future.catch_loop (owned Future future, owned FutureCallback callback)
Asynchronously calls callback when future
rejects.
- public Future.enum (Type enum_type, uint enum_value)
Creates a new [class@Dex.
- public Future.finally (owned Future future, owned FutureCallback callback)
Calls callback when future resolves or
rejects.
- public Future.finally_loop (owned Future future, owned FutureCallback callback)
Asynchronously calls callback when future
rejects or resolves.
- public Future.firstv (Future[] futures)
Creates a new [class@Dex.
- public Future.for_boolean (bool v_bool)
Creates a new [class@Dex.
- public Future.for_double (double v_double)
Creates a new [class@Dex.
- public Future.for_errno (int errno_)
Creates a new rejected future using errno_ as the value
of errno for the GError.
- public Future.for_error (owned Error error)
Creates a read-only [class@Dex.
- public Future.for_fd (int fd)
Creates a new future that resolves to fd.
- public Future.for_float (float v_float)
Creates a new [class@Dex.
- public Future.for_int (int v_int)
Creates a new [class@Dex.
- public Future.for_int64 (int64 v_int64)
Creates a new [class@Dex.
- public Future.for_object (Object value)
Creates a new [class@Dex.
- public Future.for_pointer (void* pointer)
Creates a new [class@Dex.
- public Future.for_string (string string)
Creates a new [class@Dex.
- public Future.for_uint (uint v_uint)
Creates a new [class@Dex.
- public Future.for_uint64 (uint64 v_uint64)
Creates a new [class@Dex.
- public Future.for_value (Value value)
Creates a read-only [class@Dex.
- public Future.infinite ()
Creates an infinite future that will never resolve or reject.
- public Future.take_object (owned Object? value)
Creates a new [class@Dex.
- public Future.take_string (owned string string)
Creates a new [class@Dex.
- public Future.then (owned Future future, owned FutureCallback callback)
Calls callback when future resolves.
- public Future.then_loop (owned Future future, owned FutureCallback callback)
Asynchronously calls callback when future
resolves.
- public Future.with_deadline (owned Future future, int64 deadline)
Creates a new [class@Dex.
- public Future.with_timeout (owned Future future, int64 usec)
Creates a new [class@Dex.
- public Future.with_timeout_msec (owned Future future, int msec)
Creates a new [class@Dex.
- public Future.with_timeout_seconds (owned Future future, int seconds)
Creates a new [class@Dex.
Methods:
Inherited Members:
All known members inherited from class Dex.Object