v20.57.0
版本发布时间: 2024-01-22 19:21:27
uNetworking/uWebSockets最新发布版本:v20.64.0(2024-07-04 03:06:24)
Experimental cross-platform uWS::LocalCluster
We've always supported multi-CPU scaling as detailed in the HelloWorldThreaded.cpp
example and benchmarking blog posts. However, this example has only been properly supported on Linux systems and contained some really ugly boiler plate code.
This release adds the uWS::LocalCluster
helper that works properly on Windows, macOS, Linux and makes it easy to take any single-CPU app and make it scale over all available CPU-cores by default:
uWS::App(options).get(pattern, handler).listen(port, handler).run();
simply becomes
uWS::LocalCluster(options, [](uWS::App &app) {
app.get(pattern, handler).listen(port, handler);
});
This is reflected in the updated HelloWorldThreaded.cpp example and works for both SSL and non-SSL clusters.