用于 Python 和 Erlang 交互的轻量级协议

发布于 2024-08-30 09:33:24 字数 102 浏览 1 评论 0原文

Python 代码和 Erlang 代码通过 Internet 进行交互时首选使用哪种协议? ASN.1 对我来说是理想的选择,但它在 Python 中的实现无法根据符号生成编码器/解码器。

What protocol preferred to use for interaction between Python-code and Erlang-code over Internet? ASN.1 would be ideally for me, but its implementation in Python cannot generate encoder/decoder out from notation.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

放赐 2024-09-06 09:33:24

您检查过 Google 的协议缓冲区吗?
它非常易于使用,并且有一个 Erlang 实现可用

Did you check Google's protocol buffers?
It is very easy to use and there is an Erlang implementation available

她说她爱他 2024-09-06 09:33:24

好吧,您可以使用 JSONBERT

JSON 很容易被人类读取,因为它只是 ASCII。要发送二进制数据,您需要对其进行编码(例如使用 base64)。

另一个解决方案是使用 BERT。 BERT 基于“erlang 外部二进制格式”进行序列化,因此 erlang 方面非常简单;)

Well, you could use JSON or BERT.

JSON is easily reable by humans, as it is ASCII only. To send binary data, you need to encode them (e.g. with base64).

Another solution would be using BERT. BERT is based on the "erlang external binary format" for serialization, so the erlang side is pretty simple ;)

就是爱搞怪 2024-09-06 09:33:24

另外,您可能还想看看 Apache Thrift,这是一个同时支持 Python 和 Erlang 的 IDL。

Also, you might want to have a look to Apache Thrift, an IDL supporting both Python and Erlang.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文