Can Apache Thrift push notifications to clients?

我与影子孤独终老i 提交于 2019-12-10 03:41:55

问题


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.

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


回答1:


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.

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.

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



来源:https://stackoverflow.com/questions/5566828/can-apache-thrift-push-notifications-to-clients

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!