Fastly Compute C++ SDK
Loading...
Searching...
No Matches
fastly::cache::core::PendingTransaction Class Reference

#include <core.h>

Public Member Functions

tl::expected< bool, CacheErrorpending () const
tl::expected< Transaction, CacheErrorwait () &&

Friends

class TransactionLookupBuilder

Detailed Description

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().

Member Function Documentation

◆ pending()

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.

◆ wait()

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.

◆ TransactionLookupBuilder

friend class TransactionLookupBuilder
friend

The documentation for this class was generated from the following file: