mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-11-22 20:11:46 +00:00
Run the test suite with keep-alive parking on in CI, and mark it experimental
CPPHTTPLIB_KEEPALIVE_PARKING makes every Server start with parking on. The OpenSSL jobs on Ubuntu (epoll) and macOS (kqueue) now also run the whole suite built with it, which used to be done only locally. The two tests that check the blocking path turn parking off explicitly. README and the cookbook call the feature experimental and say that a server whose event loop cannot be set up serves as it does without it.
This commit is contained in:
1 parent
00e2fd89e8
commit
a8d58085cb
8 files changed
+42
-4
No files matched your search
@@ -56,11 +56,13 @@ By default, a Keep-Alive connection holds a worker thread for its entire lifetim
|
||||
|
||||
## Keep idle connections off the threads
|
||||
|
||||
> **Note:** Keep-alive parking is experimental. Its behavior may change in a future release.
|
||||
|
||||
```cpp
|
||||
svr.set_keep_alive_parking(true); // call it before listen()
|
||||
```
|
||||
|
||||
With keep-alive parking, a connection waiting for its next request is handed to an event loop instead of keeping its worker thread, and goes back to a worker when the request arrives. An idle connection then costs a socket and some memory (a few kilobytes, more with TLS) instead of a thread, and connections that outnumber the threads take turns instead of waiting for one to close. `SSLServer` supports it too.
|
||||
With keep-alive parking, a connection waiting for its next request is handed to an event loop instead of keeping its worker thread, and goes back to a worker when the request arrives. An idle connection then costs a socket and some memory (a few kilobytes, more with TLS) instead of a thread, and connections that outnumber the threads take turns instead of waiting for one to close. `SSLServer` supports it too. Defining `CPPHTTPLIB_KEEPALIVE_PARKING` as `true` turns it on for every server.
|
||||
|
||||
What changes with it:
|
||||
|
||||
|
||||
Reference in new issue
Block a user