Dex – 1
Description: Reference for Dex-1

### Namespace

# Dex – 1

A GNOME library for deferred execution

Version | 0.10.0
Authors | Christian Hergert
License | LGPL-2.1-or-later
Website | https://gitlab.gnome.org/GNOME/libdex/
Source | https://gitlab.gnome.org/GNOME/libdex/

#### Build

C headers | `libdex.h`
pkg-config files | `libdex-1`

#### Dependencies

GLib—2.0 | The base type system library
| Browse documentation
GObject—2.0 | The base type system library
| Browse documentation

#### Additional documentation

- Overview
- Classes Hierarchy

#### Classes

AsyncPair |
AsyncResult | `DexAsyncResult` is used to integrate a `DexFuture` with `GAsyncResult`.
Block | `DexBlock` represents a callback closure that can be scheduled to run within a specific `GMainContext`.
Cancellable | `DexCancellable` is a simple cancellation primitive which allows for you to create `DexFuture` that will reject upon cancellation.
Channel |
Delayed | `DexDelayed` is a future which will resolve or reject the value of another `DexFuture` when `dex_delayed_release()` is called.
Fiber | `DexFiber` is a fiber (or coroutine) which itself is a `DexFuture`.
Future | `DexFuture` is the base class representing a future which may resolve with a value or reject with error at some point in the future.
FutureSet | `DexFutureSet` represents a set of `DexFuture`.
MainScheduler | `DexMainScheduler` is the scheduler used on the default thread of an application. It is meant to integrate with your main loop.
Object | `DexObject` is the basic building block of types defined within libdex. Futures, Schedulers, and Channels all inherit from DexObject which provides features like thread-safe weak pointers and memory management operations.
Promise | `DexPromise` is a convenient `DexFuture` for prpoagating a result or rejection in appliction and library code.
Scheduler | `DexScheduler` is the base class used by schedulers.
StaticFuture | `DexStaticFuture` represents a future that is resolved from the initial state.
ThreadPoolScheduler | `DexThreadPoolScheduler` is a `DexScheduler` that will dispatch work items and fibers to sub-schedulers on a specific operating system thread.
Timeout | `DexTimeout` is a `DexFuture` that will resolve after the configured period of time.
UnixSignal | `DexUnixSignal` is a `DexFuture` that will resolve when a specific unix signal has been received.

#### Structs

AioContext |
AsyncPairInfo |

#### Enumerations

BlockKind |
FutureStatus |

#### Error Domains

Error |

#### Callbacks

FiberFunc | This function prototype is used for spawning fibers. A fiber is a lightweight, cooperative-multitasking feature where the fiber is given its own stack. The fiber runs until it reaches a point of suspension (using `dex_await` or similar) or exits the fiber.
FutureCallback | A `DexFutureCallback` can be executed from a `DexBlock` as response to another `DexFuture` resolving or rejecting.
SchedulerFunc |

#### Functions

aio_read | An asynchronous `pread()` wrapper.
aio_write | An asynchronous `pwrite()` wrapper.
bus_get | Wrapper for g_bus_get(). since: 0.4
dbus_connection_call | Wrapper for g_dbus_connection_call(). since: 0.4
dbus_connection_call_with_unix_fd_list | Wrapper for g_dbus_connection_call_with_unix_fd_list(). since: 0.4
dbus_connection_send_message_with_reply | Wrapper for g_dbus_connection_send_message_with_reply(). since: 0.4
error_quark |
file_copy | Asynchronously copies a file and returns a `DexFuture` which can be observed for the result.
file_delete | Asynchronously deletes a file and returns a `DexFuture` which can be observed for the result.
file_enumerate_children |
file_enumerator_next_files |
file_load_contents_bytes |
file_make_directory | Asynchronously creates a directory and returns `DexFuture` which can be observed for the result.
file_query_exists | Queries to see if `file` exists asynchronously. since: 0.6
file_query_info |
file_read | Asynchronously opens a file for reading.
file_replace |
file_replace_contents_bytes | Wraps g_file_replace_contents_bytes_async().
get_min_stack_size |
get_page_size |
init |
input_stream_close |
input_stream_read |
input_stream_read_bytes |
input_stream_skip |
io_stream_close |
output_stream_close |
output_stream_splice |
output_stream_write |
output_stream_write_bytes |
resolver_lookup_by_name |
socket_client_connect |
socket_listener_accept |
subprocess_wait_check | Creates a future that awaits for `subprocess` to complete using g_subprocess_wait_check_async(). since: 0.4
value_get_object | Retrieves the `DexObject` stored inside the given `value`. since: 0.4
value_set_object | Stores the given `DexObject` inside `value`. since: 0.4
value_take_object | Stores the given `DexObject` inside `value`. since: 0.4

#### Function Macros

ASYNC_PAIR_INFO_BOOLEAN |
ASYNC_PAIR_INFO_BOXED |
ASYNC_PAIR_INFO_INT |
ASYNC_PAIR_INFO_INT64 |
ASYNC_PAIR_INFO_LONG |
ASYNC_PAIR_INFO_OBJECT |
ASYNC_PAIR_INFO_POINTER |
ASYNC_PAIR_INFO_STRING |
ASYNC_PAIR_INFO_UINT |
ASYNC_PAIR_INFO_UINT64 |
ASYNC_PAIR_INFO_ULONG |
DEPRECATED_FOR |
DEPRECATED_IN_1_0_FOR |
future_new_false |
future_new_true |
OBJECT_TYPE |
OBJECT_TYPE_NAME |
return_error_if_fail |
UNAVAILABLE |