I have three quetions.
thanks!
Thrift has doxygen docs, but they don't seem to get built. They're not terribly pretty. To generate a copy, run (in the thrift source directory) doxygen -g Doxyfile
, change RECURSIVE to YES, then run doxygen Doxyfile
.
In answer to your questions:
Which client? There are whole bunch of different thrift transports. In general, there isn't (AFAICT) any global state, so you can create different clients in different threads. If you're trying to use the same transport in multiple threads, you probably want manual locking unless you've read the code and confirmed that it's okay.
I haven't seen one. AFAICT there are just a bunch of transports that you can connect yourself. There's the TSocketPool, but that's a load-balancing tool, which isn't what I think you're looking for.
My advice: use the memory transport only and do your own networking. What Thrift does probably isn't what you want to do, and, even if it is, their documentation and packaging is pretty bad. (Or use protocol buffers instead of thrift -- they are IMO much better maintained these days. I think this even though I was a thrift contributor way back when.)
with thrift 0.12.
The 'concurrent' client is a thread safe client that correctly handles out of order responses. It is slower than the regular client, so should only be used when you need to share a connection among multiple threads
Defining a ExampleService (example.thrift) you should have:
class ExampleServiceConcurrentClient : virtual public ExampleServiceIf {
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With