Streaming API 的 Java 客户端 hbc

码农软件 · 软件分类 · 网站API · 2019-03-10 11:26:58

软件介绍

hbc (Hosebird Client)是Twitter Streaming API 的 Java 客户端开发包。

主要特性:

  • 支持GZip、OAuth和分块(partitioning);

  • 自动重新连接,并进行适当的backfill计数;

  • 访问原始字节的有效负载;

  • 适时重新分配,并进行相关统计。

包含了2个主要模块:

  • hbc-core:该模块使用了一个简单的消息队列,用户可以轮询消息。

  • hbc-twitter4j:该模块允许开发者在消息队列中使用Twitter4J项目和它的数据模型,以提供一个分析层。

示例代码:

ClientBuilder builder = new ClientBuilder()
  .name("Hosebird-Client-01")                              // optional: mainly for the logs
  .hosts(hosebirdHosts)
  .authentication(hosebirdAuth)
  .endpoint(hosebirdEndpoint)
  .processor(new StringDelimitedProcessor(msgQueue))
  .eventMessageQueue(eventQueue);                          // optional: use this if you want to process client events

Client hosebirdClient = builder.build();
// Attempts to establish a connection.
hosebirdClient.connect();

// on a different thread, or multiple different threads....
while (!client.isDone()) {
  String msg = msgQueue.take();
  something(msg);
  profit();
}

hosebirdClient.shutdown();

 

本文地址:https://codercto.com/soft/d/1031.html

Producter 让产品从0到1

Producter 让产品从0到1

周楷雯 / 人民邮电出版社 / 2016-12-25 / CNY 69.00

这是一本以App Store首页推荐的成功App为例阐述如何完成一款App产品的设计、开发和营销的书。在这本书之后,作者的《一炷香》和《字里行间》两款产品也接连被App Store首页推荐。 《Producter 让产品从0到1》从产品的设计、产品的实现、产品的迭代、产品的营销、产品的进阶等几个角度,全面讲解了产品设计的基本原则、设计的重要性、设计的感觉、实用的设计工具、简单的iOS开发、产......一起来看看 《Producter 让产品从0到1》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

html转js在线工具
html转js在线工具

html转js在线工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试