-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Updated server_queue to delete tasks from queue when server is shutdown. Feature Request #6421 #6941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
based off tests made in req_cancelation_tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test is probably a good start
@@ -29,6 +29,8 @@ | |||
#include <thread> | |||
#include <signal.h> | |||
#include <memory> | |||
#include <iostream> | |||
#include <boost/asio.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boost will never be required
boost::system::error_code ec; | ||
|
||
// Try to connect | ||
connect(socket, resolver.resolve({server, port}), ec); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nonsense to inner call the server itself. You have everything needed inside the process.
Please don't use external heavy libraries like boost, #define CPPHTTPLIB_OPENSSL_SUPPORT
#include "path/to/httplib.h"
// HTTP
httplib::Client cli("http://cpp-httplib-server.yhirose.repl.co");
// HTTPS
httplib::Client cli("https://cpp-httplib-server.yhirose.repl.co");
auto res = cli.Get("/hi");
res->status;
res->body; |
Ive adding a server health checker that will periodically make sure the server is up and running when fetching requests, and cancels the request if the server is down. Please let me know if there are any changes I should make.
For: Feature Request: Task Cancellation on Client Disconnection #6421