与 Thrift 或 Protocol Buffers 的双向通信
(抱歉我的英语)
可以构建一个应用程序(实际上是2)来实现进程之间的双向通信吗?
我知道两个“框架”来通信不同的进程(使用不同的语言)Thrift 和 Protocol buffers。
我知道 thrift 在客户端/服务器模式下工作,所以如果我想要双向通信,我需要像客户端和服务器一样构建两端/进程。
客户端/服务器<------------------------->客户端/服务器
我不知道这种方法是否正确。
但是..我无法找到有关使用协议缓冲区的信息。这可能吗?
我有一个 C++ 进程和一个 Node.js (Javascript) 应用程序.. C++ 进程向 Node.js 应用程序发送通知(这很好用,我使用 thrift 进行测试)..
在另一端,用户与Node.js 应用程序.. 在某些情况下,node.js 应用程序需要通知 C++ 进程.. 所以我需要双向通信..
有什么想法吗?
提前致谢
(sorry for my english)
It's possible to build an application (2 in deed ) that implement bidirectional communication between process?.
I know two "Frameworks" to communicate different process (in different languages) Thrift and Protocol buffers.
I know that thrift works in a client/server mode, so if i want bidirectional communication i need to build the two sides/process like a client and server at time.
client/server <-------------------------> client/server
I don't know if this approach is correct.
But.. i can't find information about this using Protocol Buffers. is this possible?
I have a C++ process and a Node.js (Javascript) application .. the C++ process send a notification to de Node.js app (this works good, i use thrift to test) ..
In the other side, the user interact with the Node.js app.. in some event, the node.js app need to notify to de C++ process .. so i need bidirectional communication..
Any idea?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这篇文章有一些 Thrift 的选项 -
Thrift 异步函数中的回调?
msdark 的问题实际上是关于双向事件信号发送,而不仅仅是双向数据传输。数据可以使用 Thrift 或 ProtoBufs 双向传输。从根本上来说,任何 IPC 都必须以双向方式传输数据——RPC 调用和返回值。异步客户端到服务器事件信号是使用RPC内置的,但是异步服务器到客户端需要更多工作。该领域已经开展了工作。 Google 搜索“thrift async”的前两个结果值得一读。
Thrift:双向异步 RPC
等...
This post has some options for Thrift -
Callbacks in Thrift Asynchronous Functions?
msdark's question is really about bidirectional event signaling and not simply bidirectional data transfer. Data may be transferred in both directions using Thrift or ProtoBufs. Fundamentally any IPC must transfer data both ways -- an RPC call and return value(s). Asynchronous client to server event signaling is built in using an RPC, but async server to client takes more work. There has been work in that area. The top two results in a Google search for 'thrift async' are good reads.
Thrift: Bidirectional Async RPC
etc...