Module foundationdb::future

source ·
Expand description

Most functions in the FoundationDB API are asynchronous, meaning that they may return to the caller before actually delivering their result.

These functions always return FDBFuture*. An FDBFuture object represents a result value or error to be delivered at some future time. You can wait for a Future to be “ready” – to have a value or error delivered – by setting a callback function, or by blocking a thread, or by polling. Once a Future is ready, you can extract either an error code or a value of the appropriate type (the documentation for the original function will tell you which fdb_future_get_*() function you should call).

Futures make it easy to do multiple operations in parallel, by calling several asynchronous functions before waiting for any of the results. This can be important for reducing the latency of transactions.

The Rust API Client has been implemented to use the Rust futures crate, and should work within that ecosystem (suchas Tokio). See Rust futures documentation.

Structs

Represents a single key-value pair in the output of fdb_future_get_keyvalue_array().
Represents the output of fdb_future_get_keyvalue_array().