Apache Thrift 可以向客户端推送通知吗?

编程入门 行业动态 更新时间:2024-10-27 11:26:36
本文介绍了Apache Thrift 可以向客户端推送通知吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我希望使用 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 14:42:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1395682.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   通知   Apache   Thrift

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!