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
async_http: non-blocking HTTP client module #480
Conversation
I would like this to be merged into the CURL module (it's mentioned in the todo). Having multiple modules calling CURL is not a good thing, especially if they use HTTPS (multiple initialisations of OpenSSL is not a good thing). |
Having said that I agree that we need async HTTP :-) |
I agree on having a single curl based module. I started looking at curl On Mon, Jan 18, 2016 at 3:52 PM, Olle E. Johansson <notifications@github.com
|
I am ok with many modules targeting to offer similar functionality, if they have different approach -- like lcr can be achieved with couple of modules. If there is a conflict with another module, that needs to be documented. Some remarks:
|
Thanks for this module - a very useful feature!
|
Thanks for the feedback Daniel. On Wed, Jan 20, 2016 at 1:22 PM, Daniel-Constantin Mierla <
|
Thanks Hugh for the feedback! On Wed, Jan 20, 2016 at 5:34 PM, Hugh Waite notifications@github.com
Again, thanks for the feedback. |
Since both modules are using CURL they need similar names. Since they should not be used at the same time, this should be documented. We can still rename the CURL module before release. Stubbornly I still think, from a product management standpoint, that these should be the same module before release. If not, either name them CURL and CURL_ASYNC or HTTP and HTTP_ASYNC Not being able to use them at the same time is a bug from my point of view. The easiest way to fix this is to move the call to CURL from http_async to CURL, add it to the CURL API and have the Http_Async module use the curl module for talking with libcurl. That way, both modules can be loaded at the same time, without a large merge of the code at this point. A huge win for all Kamailio users! |
If both modules should be used at the same time, the most problematic point would be calling So, in a nutshell, to use both modules at the same time, libcurl initialization should be done in a shared API that would ensure that the initialization is done only once per process. To do this, we also have to agree on the memory API used by libcurl. In your opinion(s), what is the best alternative: libc's malloc, SHM, PKG, dedicated (private / shared) pool? |
Isn't curl using the system memory by default? It should not affect the pkg usage. On the other hand, I don't think people will use the two modules discussed here at the same time. if there is a conflict in initializing the curl library, then utils and xcap_client are also using it. |
It is using system memory by default indeed, but we preferred kamailio's pools, to have a better view/control on what is going on. |
OK, maybe would be good to have a mod param option to control what mem pool (system or kamailio) is going to be use. I think the module should be merged, then renamed to http_client or httpc. If combining with curl module proves necessary over the time, then the curl module can end up being just a wrapper to libcurl, with the other modules (httpc, xcap_client) binding internally to curl module. |
Some commits following received suggestions:
|
Trying to summarize the discussion from yesterday in Brussels at Fosdem between @oej, @grumvalski, @camilleoudot & all: The main points (if I forgot something or misunderstood, just add more):
|
b9857e1
to
400bc4e
Compare
400bc4e
to
50fca23
Compare
http_async_client: non-blocking async HTTP client module
This new module, based on libevent and cURL multi interface, implements non blocking HTTP queries.