All of the craziness for thread-safety and asynchronous operations lives here.
The idea is that if someone comes up with a better way of managing connection state they can build what they want on top of the Core module.
Operations are not entirely asynch - they block until a response is returned.
But we don't hold the connection lock while we're blocking, so other threads can still put requests on the connection.
This should work well where each thread needs one request to do it's job.
If you have a good idea for what an asynchronous API should look like let me know. It shouldn't be too hard to add on to what's already here.
For thread safety of operations, we perform all requests on a wrapper around a handle.
Create a connection. Please don't use the handle after opening a connection with it.
Place a synchronous request which only returns one reply
Place a synchronous request which may return
multiple response (
Stat, pretty much)