If the future is the result of a call to std::async that used lazy evaluation, this function returns immediately without waiting. This function may block for longer than timeout_duration due to scheduling or resource contention delays. The standard recommends that a steady clock is used to measure the duration.

Understanding the Context

The operation behaves as though set_value, set_exception, set_value_at_thread_exit, and set_exception_at_thread_exit acquire a single mutex associated with the promise object while updating the promise object. Calls to this function do not introduce data races with calls to get_future (therefore they need not synchronize with each other). A future represents the result of an asynchronous operation, and can have two states: uncompleted or completed. Most likely, as you aren't doing this just for fun, you actually need the results of that Future<T> to progress in your application.

Key Insights

You need to display the number from the database or the list of movies found.