异步双向 RPC [英] Asynchronous Bidirectional RPC

查看:53
本文介绍了异步双向 RPC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找使用 TCP 的 Java 或 Python(首选 Python)的 RPC 库.它应该支持:

I am looking for a RPC library in Java or Python (Python is preferred) that uses TCP. It should support:

  • 异步
  • 双向
  • RPC
  • 某种事件循环(带有回调或类似的)

有什么推荐吗?我看过类似 bjsonrpc 的东西,这似乎是正确的事情,但是服务器似乎无法识别哪些连接;因此,如果用户已经确定了自己的身份并且来自另一个用户的请求向该用户发送消息,则它不会公开该用户的连接,因此我们可以发送消息.

Any recommendations? I have looked a things like bjsonrpc which seemed to be the right sort of thing however it didn't seem possible for the server to identify which connections; so if a user has identified himself/herself and a request comes in from another user to send a message to that user it doesn't expose that users connection so we can send the message.

推荐答案

你绝对应该看看 Twisted.它是一个基于事件的 Python 网络框架,具有支持选择、轮询、epoll、kqueue 和 I/O 完成端口的事件循环(称为反应器")的实现,并使用名为 延迟

You should definitely check out Twisted. It's an event-based Python networking framework that has an implementation of an event loop (called the "reactor") supporting select, poll, epoll, kqueue and I/O completion ports, and mediates asynchronous calls with objects called Deferreds

至于您的 RPC 要求,也许您应该查看 Twisted 的 PB 库或 AMP.

As for your RPC requirement, perhaps you should check out Twisted's PB library or AMP.

这篇关于异步双向 RPC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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