hbc 介绍
hbc (Hosebird Client)是Twitter Streaming API 的 Java 客户端开发包。
主要特性:
包含了2个主要模块:
示例代码:
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();
hbc 官网
https://github.com/twitter/hbc
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。