Skip to content
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

Updated server_queue to delete tasks from queue when server is shutdown. Feature Request #6421 #6941

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rahsuri
Copy link

@rahsuri rahsuri commented Apr 27, 2024

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

@rahsuri rahsuri changed the title Updated server_queue to delete tasks from queue when server is shutdown. Updated server_queue to delete tasks from queue when server is shutdown. Feature Request #6421 Apr 27, 2024
@phymbert phymbert added the demo Demonstrate some concept or idea, not intended to be merged label Apr 27, 2024
Copy link
Collaborator

@phymbert phymbert left a 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>
Copy link
Collaborator

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);
Copy link
Collaborator

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.

@FSSRepo
Copy link
Collaborator

FSSRepo commented May 1, 2024

Please don't use external heavy libraries like boost, http-lib has a fetch api.

#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;

@mofosyne mofosyne added the review complexity : low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
demo Demonstrate some concept or idea, not intended to be merged review complexity : low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants