Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Did you notice that https://oatpp.io is served by oatpp :)?


I have a question. I want to adopt oatpp.io, but I'm using a synchronous database driver mongo-cxx-driver. Can I still benefit from oat++'s coroutine? Also, when using coroutine, will the server be a single-thread process? or it will be a multiple thread process with each thread using coroutines (to fully utilize the cpu)?

If my server wants to visit third party rest APIs in an asynchronized way, what's the best asynchronized library to choose to make use of coroutine?


Thank you for the question.

-----------------------------------------------------------------------------

// I want to adopt oatpp.io, but I'm using a synchronous database driver mongo-cxx-driver.

- Unfortunately no - if your driver has only synchronous API you can use it with multithreaded oatpp only.

-----------------------------------------------------------------------------

// Also, when using coroutine, will the server be a single-thread process?

// or it will be a multiple thread process with each thread using coroutines (to fully utilize the cpu)

- Yes, it will be a multiple thread process with each thread using coroutines. You can configure how many threads should run the AsyncHttpConnectionHandler. Number of threads is passed to the AsyncHttpConnectionHandler constructor. Also you may tweak it in compile time via option:

"-D OATPP_ASYNC_HTTP_CONNECTION_HANDLER_THREAD_NUM_DEFAULT=<num of threads>"

You have to play with this parameter in order to achieve best performance. In most cases on : - Linux it's value should be (<num of CPUs> - 1). - On MacOS it's value should be 2.

-----------------------------------------------------------------------------

// If my server wants to visit third party rest APIs in an asynchronous way,

// what's the best asynchronized library to choose to make use of coroutine?

- Native way to do it is to use oatpp ApiClient https://oatpp.io/docs/component/api-client

it provides two declarations:

- API_CALL("GET", "/resource", getResource) ///< Example of API call

- API_CALL_ASYNC("GET", "/resource", getResourceAsync) ///< Example of Async API call

Also there is an example project with the full example how to make asynchronous calls to rest APIs https://github.com/oatpp/oatpp-examples/tree/master/tls-libr...

There is no README currently in this example, but I gonna add asap.


On a corporate proxied network I'm getting this response

    server=oatpp/0.18.9
    code=431
    description=Request Header Fields Too Large
    message= Can't parse headers
It seems to work okay on the non-corporate network


There is a limitation on the header size in the oatpp html parser.

Think I should tweak this.

Thank you for the note!


Perhaps my NVidia tablet is out of date but that link comes up secure connection failed under Firefox Focus. I have not done deep dive to study but not a common issue for me with focus. (Edit: might be intermediate cerificates issue.)


Just a small thing I found: your site seems to break scrolling on iOS.


Yeah known issue, I am not a JS master:(




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: