News for hackers. Stuff that matters.

an-tao

About 5M bytes in size, considering that the drogon application is statically linked, I am afraid it has no advantage in binary size.
It's an embarrassing mistake, thank you for your reminder, but it seems that it's too late to change the name.
You can register handler like this in Drogon:

   drogon::app.registerHttpMethod("/test",
                                   [=](const HttpRequestPtr& req,
                                       const std::function<void (const HttpResponsePtr &)> & callback)
                                   {
                                       Json::Value json;
                                       json["result"]="ok";
                                       auto resp=HttpResponse::newHttpJsonResponse(json);
                                       callback(resp);
                                   },
                                   {Get,"LoginFilter"});

The method in the readme file is for decoupling. Imagine a scene with dozens of path handlers. Isn't it better to disperse them in their respective classes?

Of course, for very simple logic, the interface you are talking about is really more intuitive, I will consider adding such an interface. Thank you for your comment.

For benchmarking I have submitted it to the famous TFB and I am waiting for the result of testing round 18. https://github.com/TechEmpower/FrameworkBenchmarks/tree/mast...
Good question! If the type of the parameter of callback is an r-reference, users must move resp into the callback. Note that the resp is a shared_ptr, which means callback can reuse the buffer or do anything to the resp object and copying smart pointers does not require too much cost.
Maybe I misused the proper nouns, what I mean is 'non-blocking I/O'. Thanks for your reminder.
Your suggestion is very good, I have made some modifications.