samuel / go-thrift

A native Thrift package for Go
BSD 3-Clause "New" or "Revised" License
384 stars 110 forks source link

Connection pooling? #5

Open blakesmith opened 11 years ago

blakesmith commented 11 years ago

For other RPC clients that use HTTP as the codec, connection pooling is handled at the HTTP Client level. Since go-thrift uses a different codec, how should I tackle connection pooling in a concurrent environment?

A few thoughts:

What are your thoughts?

Thanks!

Blake

samuel commented 11 years ago

Sorry for taking so long to get back to you on this.

I'm leaving the connection pooling out of the go-thrift library since it's really using the built in RPC package in Go (which is safe for concurrent use). To add connection pooling it would be best to add a layer around that package. The strategy to choose a connection may get tricky though since it's asynchronous (which is something I should discuss more in the docs.. not all thrift servers support asynchronous requests).