PendingTransaction

Classin corecompute-sdk-cpp 0.7.0View source

Include fastly/cache/core.h to use this class.

A cache transaction suspended between lookup and response.

This handle is produced by TransactionLookupBuilder::execute_async().

Callers can check whether or not the request was instructed to wait behind another caller by calling PendingTransaction::pending(), and can complete the request (returning a Transaction) by calling PendingTransaction::wait().

Methods

tl::expected<bool, CacheError> fastly::cache::core::PendingTransaction::pending() const

Returns true if this request was instructed to wait for another request to insert the looked-up item, and false otherwise.

Note that, even if pending() returns true, the Transaction returned by wait() may still be required to insert (or update) the object. This can happen if the caller providing the item called Transaction::cancel_insert_or_update() or encountered an error.

Returns

tl::expected<bool, CacheError>
tl::expected<Transaction, CacheError> fastly::cache::core::PendingTransaction::wait() &&

Returns the Transaction resulting from the lookup that produced this PendingTransaction, waiting for another caller to provide the requested item if necessary.

Returns

tl::expected<Transaction, CacheError>