after receiving request ()
Try to process DB SP..
Is there any way to do it in other threads by putting it in a queue without doing DB processing immediately?
// Not this way.
CROW_ROUTE(m_lpWebServerBase->m_kCrowApp, "/").methods("POST"_method)([](const crow::request &_request) {
....
std::string test = DB.callSPTestSelect();
return crow::response(test.c_str());
});
// Processed in this way
CROW_ROUTE(m_lpWebServerBase->m_kCrowApp, "/").methods("POST"_method)([](const crow::request &_request) {
....
queue.push(...);
return "";
});
void DBThread()
{
...
getQueue();
std::string test = DB.callSPTestSelect();
return crow::response(test.c_str());
...
}
after receiving request () Try to process DB SP.. Is there any way to do it in other threads by putting it in a queue without doing DB processing immediately?