sholsapp / gallocy

A distributed shared memory infrastructure.
27 stars 9 forks source link

Add a request client abstraction. #18

Closed sholsapp closed 8 years ago

sholsapp commented 8 years ago

We have several choices when it comes to a request client. We can choose from:

Whatever we choose, we need only to implement whatever interface we come up with. Right now, everything is hard wired to use a vendor (and modified) version of https://github.com/mrtazz/restclient-cpp, which lives in the gallocy/external module.

This will let us be flexible with a client when we decide which one works best, and will make it easier to move away from TCP and HTTP when that inevitably happens.

sholsapp commented 8 years ago

I think that while doing this we should come up with a very basic HTTP client that does not use cURL under the hood. I'm running into tons of issues with cURL and concurrency, which it is admittedly very finicky about. See https://curl.haxx.se/libcurl/c/threadsafe.html for example. What's worse is that restclient-cpp or cpr make use of cURL in opaque ways, so it's unclear what synchronization they're doing.

Let's adopt a simple socket reader/writer that does what we want for the base usage of this abstraction and test the hell out of it to make sure it works. When we mature we can add back a cURL abstraction. E.g., https://dev.w3.org/libwww/Library/src/HTTP.c is bonehead simple and looks easy to test.

sholsapp commented 8 years ago

This abstraction already exists. What I really mean is use the Response and Request abstractions to build our own client. Updating the title accordingly.