MXS-1951: Move worker selection into Listener

The worker to which the client DCB is assigned to is now chosen by the
Listener. This makes the protocol code simpler which is always a good
thing.
This commit is contained in:
Markus Mäkelä
2019-03-19 11:19:56 +02:00
parent 5c7846da3f
commit db97c3343d
2 changed files with 25 additions and 50 deletions

View File

@ -1024,7 +1024,10 @@ uint32_t Listener::poll_handler(MXB_POLL_DATA* data, MXB_WORKER* worker, uint32_
while ((client_dcb = listener->accept_one_dcb()))
{
listener->m_proto_func.accept(client_dcb);
auto worker = mxs::RoutingWorker::pick_worker();
worker->execute([listener, client_dcb]() {
listener->m_proto_func.accept(client_dcb);
}, mxs::RoutingWorker::EXECUTE_AUTO);
}
return 1;