A Thrift client wrapper that encapsulates some common failover behavior.
Copyright 2009 Twitter, Inc. See included LICENSE file.
The public certificate for this gem is here.
Transparent connection management
Configurable failover and retry backoff
Ruby 1.9 compatibility
ThriftClient::Simple class, for working without generated bindings.
The Github source repository is here. Patches and contributions are very welcome.
Instantiate a client:
client = ThriftClient.new(CassandraRb::Client, '127.0.0.1:9160', :retries => 2)
You can then make calls to the server via the client instance as if was your internal Thrift client. The connection will be opened lazily and methods will be proxied through.
On failures, the client will try the remaining servers in the list before giving up. See ThriftClient for more.
You need Ruby 1.8 or 1.9. If you have those, just run:
sudo gem install thrift_client
To contribute changes:
Fork the project
make your change, adding tests
send a pull request to fauna and ryanking
The Github issue tracker is here.