Apache Thrift 可以向客户端推送通知吗? [英] Can Apache Thrift push notifications to clients?

查看:31
本文介绍了Apache Thrift 可以向客户端推送通知吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望使用 Apache Thrift 让一个客户端向服务器发送数据,然后让服务器将该数据推送到任何客户端.这是可能的,还是客户需要定期检查新数据?我正在寻找类似于 WCF 回调的东西.

I'm looking to use Apache Thrift to have one client send data to the server and then have the server push that data to any clients. Is this possible, or would the client need to periodically check for new data? I'm looking for something similar to WCF's callbacks.

我对 Apache Thrift 还是很陌生,我目前在 C#/.NET 中使用它,并且可能会有一个 Java 客户端.谢谢.

I'm pretty new to Apache Thrift and I'm using it in C#/.NET currently and will likely have a Java client. Thanks.

推荐答案

我不知道 Thrift RPC 机制是否是为处理单个套接字连接上的双向调用而构建的.

I don't know whether the Thrift RPC mechanism is built to handle calls going both ways on a single socket connection.

如果没有,一个简单的解决方法是打开两个套接字——一个让客户端调用服务器,另一个让服务器调用客户端.

If it doesn't, a simple workaround is to open two sockets -- one for the client to make calls to the server and another for the server to make calls to the client.

另一种解决方法是自己实现双向调用.Thrift 库是相对可插入的,因此您可以将自己的代码插入其中以处理双向调用,而无需处理其他内容.

Another workaround would be to implement two-way calling yourself. The Thrift library is relatively pluggable so you might be able to plug your own code in there to handle two-way calling without having to mess around with the other stuff.

如果您在 Thrift 邮件列表上问这个问题,您可能会得到更好的答案.

You'll probably get better answers if you ask this question on the Thrift mailing lists.

这篇关于Apache Thrift 可以向客户端推送通知吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆