百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

thrift_client

> 编程语言
开源

一个 Thrift 客户端封装器,封装了一些常见的故障转移行为

198 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个 Thrift 客户端封装器,封装了一些常见的故障转移行为

== thrift_client {}[https://travis-ci.org/twitter/thrift_client]

A Thrift client wrapper that encapsulates some common failover behavior.

== Features

  • Transparent connection management
  • Configurable failover and retry backoff
  • Ruby 2.1 compatibility
  • ThriftClient::Simple class, for working without generated bindings.

The Github source repository is {here}[http://github.com/twitter/thrift_client/]. Patches and contributions are very welcome.

== Usage

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.

client.get_string_list_property("keyspaces")

On failures, the client will try the remaining servers in the list before giving up. See ThriftClient for more.

== Timeouts

Timeouts are enforced per-try, so if you have a timeout of n and do m retries, the total time it could take is n*m.

== Connection Handling

The library will shuffle the host list then work its way down this list, only moving to the next host if it received an error or you've doing more than server_max_requests requests with that host (defaults to 0 which means there's no limit).

Servers that throw an error get marked as dead and will only be retried every server_retry_period seconds (at that time all dead servers are retried, no matter long they've been marked as dead).

== Installation

You need Ruby 2.1.7. Just run:

sudo gem install thrift_client

== Additional Documentation

Additional documentation and api access can be found {here}[http://www.rubydoc.info/gems/thrift/Thrift]

== Contributing

To contribute changes:

  1. Fork the project
  2. Make your change, adding tests
  3. Send a pull request to twitter

== Reporting problems

The Github issue tracker is {here}[http://github.com/twitter/thrift_client/issues].

== License

Copyright 2009-2012 Twitter, Inc. See included LICENSE file.

The public certificate for this gem is here[http://blog.evanweaver.com/files/evan_weaver-original-public_cert.pem].

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言