Concurrency and Source Panels
Client and Worker Files
Replay one C++ execution that builds a request in the client file, calls a worker helper in another translation unit, and returns response data.
panels
Each source file has its own panel because both files participate in the same execution trace. The Variables panel follows the call from the client file into the worker file and then back to the caller.
boundary
The client file owns the entry point and visible output. The worker file owns the routing rule that turns each command into a route and response body.
Project Entry
request_client.cpp
Replay: real traced execution (multi-file project)
#include <iostream>
#include <string>
#include <utility>
std::pair<std::string, std::string> handleRequest(const std::string& command);
int main() {
std::string command = "status";
std::string user = "reader";
auto response = handleRequest(command);
std::cout << "send=" << command << std::endl;
std::cout << "route=" << response.first << std::endl;
std::cout << "body=" << response.second << std::endl;
std::cout << "user=" << user << std::endl;
return 0;
}
#include <iostream>
#include <string>
#include <utility>
std::pair<std::string, std::string> handleRequest(const std::string& command);
int main() {
std::string command = "ping";
std::string user = "reader";
auto response = handleRequest(command);
std::cout << "send=" << command << std::endl;
std::cout << "route=" << response.first << std::endl;
std::cout << "body=" << response.second << std::endl;
std::cout << "user=" << user << std::endl;
return 0;
}
#include <iostream>
#include <string>
#include <utility>
std::pair<std::string, std::string> handleRequest(const std::string& command);
int main() {
std::string command = "count";
std::string user = "reader";
auto response = handleRequest(command);
std::cout << "send=" << command << std::endl;
std::cout << "route=" << response.first << std::endl;
std::cout << "body=" << response.second << std::endl;
std::cout << "user=" << user << std::endl;
return 0;
}
command ← status, user ← reader
7int main() {8 std::string command→ status = "status"; //@command="ping", "count"9 std::string user→ reader = "reader";10 auto response = handleRequest(commandstatus);route ← /health, body ← ready
3#include <utility>45std::pair<std::string, std::string> handleRequest(const std::string& command);67int main() {8 std::string command = "status"; //@command="ping", "count"9 std::string user = "reader";10 auto response = handleRequest(command);1112 std::cout << "send=" << command << std::endl;13 std::cout << "route=" << response.first << std::endl;14 std::cout << "body=" << response.second << std::endl;15 std::cout << "user=" << user << std::endl;values this step/healthroutereadybodystatuscommandresponse ← (empty)
9 std::string user = "reader";10 auto response→ (empty) = handleRequest(commandstatus);1112 std::cout << "send=" << commandstatus << std::endl;13 std::cout << "route=" << response(empty).first << std::endl;14 std::cout << "body=" << response(empty).second << std::endl;15 std::cout << "user=" << userreader << std::endl;16 return 0;17}outputsend=status route=/health body=ready user=reader