Code Monkey home page Code Monkey logo

beauty's People

Contributors

chr-thien avatar dfleury2 avatar dotnwat avatar nside avatar p12tic avatar valgur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beauty's Issues

conan package

Is it possible to consume the package through conan? I can't find it in conan center

HTTP Client set thread pool

Is there any to set threads for http client?
Seems like http client has only one worker thread to process async requests in order.

For Example :
/endpoint1 (3 sec processing delay)
/endpoint2 (10 sec processing delay)

When sending 10 request using http client async way, still waits response from server then send next request.

add beauty to CMakeLists.txt

How should I add to CMakeLists.txt?

for rapidyaml I have this for example:

add_subdirectory(deps/rapidyaml)
target_include_directories(test PRIVATE deps/rapidyaml/src)
target_link_libraries(test PRIVATE ryml)

Not able to disable conan install method

In readme, seems minor typo.

replace cmake .. -DCMAKE_BUILD_TYPE=Release by cmake .. -DCMAKE_BUILD_TYPE=Release -DCONAN_false to not use Conan. Hope your the dependencies are found on your Linux.

which can be

replace cmake .. -DCMAKE_BUILD_TYPE=Release by cmake .. -DCMAKE_BUILD_TYPE=Release -DCONAN=false to not use Conan. Hope your the dependencies are found on your Linux.

Even though correcting that, cmake toolchain try to find conan so it's trying to install this library through conan.. so seems like disabling conan not working as expected.

While digging through root level CMakeLists.txt file, below can be found so probably that needs to be taken under CONAN macro which worked fine for me. Also didn't understand use case of empty CONAN_EXPORTED.

if (CONAN_EXPORTED)
else()
    if (NOT EXISTS ${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
        include(${PROJECT_SOURCE_DIR}/cmake/conan.cmake)

        conan_cmake_autodetect(settings)

        conan_cmake_install(PATH_OR_REFERENCE ${PROJECT_SOURCE_DIR}/conanfile.py
                PROFILE ${CONAN_PROFILE}
                PROFILE_BUILD ${CONAN_PROFILE}
                BUILD missing
                SETTINGS ${settings}
                )
    endif()
endif()

include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake)

which can be

if (CONAN)
    if (NOT EXISTS ${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
        include(${PROJECT_SOURCE_DIR}/cmake/conan.cmake)

        conan_cmake_autodetect(settings)

        conan_cmake_install(PATH_OR_REFERENCE ${PROJECT_SOURCE_DIR}/conanfile.py
                PROFILE ${CONAN_PROFILE}
                PROFILE_BUILD ${CONAN_PROFILE}
                BUILD missing
                SETTINGS ${settings}
                )
    else()
        include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
    endif()
endif()

build error

after running cmake --build . -j4 I get:
`fatal error: boost/json.hpp: No such file or directory #include <boost/json.hpp>

Possible Memory Leak On beauty::application destructor

Hi,
Due to investigation,

application::~application()
{
    stop(false);  //  memory leak possibility which not stop timers
}

but timers are not destructing :

void
application::stop(bool reset)
{
...
    if (reset) {
        for(auto&& t : timers) {
            t->stop();
        }
        timers.clear();
    }
...
}

In timer.hpp, _timer member uses _app.ioc() but seems like ioc is stopped on application destruction.

My question is why destruction of application set reset false?

beauty is beautiful!

hi dev, just came here to say thanks for developing this awesome library. glad to be here and creating the first issue before it become famous! i'm currently using it in production and it works like a charm.

can't get x-www-form-urlencoded params

This is my code:
server.add_route("/person")
.post([](const auto& req, auto& res) {
std::istringstream iss(req.body());

        std::string id, name;
        iss >> id >> name;
        std::cout  << id << std::endl;
    });

This is the client call:

curl --location --request POST 'http://<ip>:<port>/person' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'id=88' \
--data-urlencode 'name=rrr'

it prints id=88&name=rrr instead of 88.

http server question

Hi,

I want to use your http server in an app. how can I integrate it with my bazel build?

Also, what json library do you suggest to parse the incoming http request and create the http resonse?

Thanks

Migrate to Conan 2.0.

I tried building this project with conan v2.04 and it seems to be broken. After some digging around turns out your current conanfile.py is not compatible with conan 2.0.
source : https://docs.conan.io/1/migrating_to_2.0/recipes.html.

The fix is simple.
But it seems like libssl doesn't support conan 2.0 either so compiling with libssl doesn't work.

here's the error from conan 2.04

ImportError: cannot import name 'ConanFile' from 'conans' (/home/gibi/.local/lib/python3.10/site-packages/conans/__init__.py)

Here is the fix according the above mentioned link

- from conans import ConanFile
+ from conan import ConanFile

- def requirements(self): 
+ def build_requirements(self):

Cheers ๐Ÿบ

Warning: Explicitly defaulted move assignment operator is implicitly deleted

Hello, thank you for this awesome tool on top of beast.

While building for Mac OS(clang-13.1), noticed below warning. So seems like either explicitly defaulted functions at server.hpp can be removed or application.hpp needs to be fixed.

~/beauty/include/beauty/server.hpp:64:13: warning: explicitly defaulted move assignment operator is implicitly deleted [-Wdefaulted-function-deleted]
    server& operator=(server&&) = default;
            ^
~/beauty/include/beauty/server.hpp:100:29: note: move assignment operator of 'server' is implicitly deleted because field '_app' is of reference type 'beauty::application &'
    beauty::application&    _app;
                            ^

Make it possible to reuse asio::io_context in single threaded applications

Hi,
Thank you for your awesome library.
If i'm not mistaken, currently it is not possible to reuse an io_context for instantiating a client or server, by reusing an existing io_context we can have multiple async libraries in asio based single threaded applications without any need to deal with synchronization and concurrency problems.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.