Session::waitForShutdown is a convenience wrapper around the asynchronous Session::shutdown call. The previous Session::waitForShutdown call waited on a std::condition_variable to signal the end of shutdown, but it's easier to just embed a std::promise in a callback to the asynchronous shutdown method.