了解 ZeroMQ [英] Understanding ZeroMQ

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

问题描述

因此,正如我在之前的帖子中所问的那样,我希望能够使用不同语言编写的程序或函数能够在它们之间进行通信.

So as I have asked in a previous post, I want to be able to make programs or functions written in different languages to communicate between them.

我最近遇到了 zeromq,我试图弄清楚这是否可以帮助我,因为它提供了某种套接字.例如,zeromq 可以在用 python 编写的程序与用 C++ 编写的程序或函数之间交换数据(或传递参数),还是它的功能完全不同?

I have come across zeromq recently and I'm trying to figure out whether or not this is something that could help me since it provides some sort of sockets. Can zeromq for example exchange data (or pass arguments) between a program written in python with a program or a function written in C++ or is its function for something completely different?

推荐答案

A: 哦,是的,这正是 ZeroMQnanomsg 框架的力量

这两者都不是sockets,而是BEHAVIOUR零*的上下文中创建的 -- 一套勇敢的格言 Scalable Formal Communication Pattern F>ramework 的设计、开发和微调是为了满足.

A: Oh Yes, exactly that is the power of ZeroMQ or nanomsg frameworks

Both of these are not sockets but rather BEHAVIOUR created within a context of a Zero-* -- a set of courageous maxims the Scaleable Formal Communication Pattern Framework was designed, developed and finetuned to meet.

这将使您能够组装自己的快速&智能消息传递层.

That will enable you to assemble your own fast & smart messaging layer(s).

不管你的第一印象如何,只要忘记你对套接字和多线程同步技巧的了解即可.

In spite of your first impression, simly do forget anything you know about sockets and multithreaded synchronisation tricks.

是的,不如忘记并建立对绿地"的新理解.

Yes, rather forget and build your new understanding on "green field".

阅读 Pieter HINTJENS 的Code Connected, Volume 1"(可在 PDF 中访问)并花几周时间了解 Pieter 的动机和典型错误锤炼了这本必读的 ZeroMQ 圣经.

Take Pieter HINTJENS' book "Code Connected, Volume 1" (accessible in PDF ) and spend a few weeks on understanding both the motivation and the typical errors Pieter has hammered into this must-read bible of ZeroMQ.

代码片段危险,以防您没有获得或完全错过大图的完整上下文.

Code-snippets are dangerous in case you did not get or completely missed the full-context of the bigger picture.

相信我.我不能给你更好的建议.您可以查看我在 ZeroMQ & 上的其他帖子.nanomsg,查看差异.

Believe me. I could not give you better advice. You may check my other posts on ZeroMQ & nanomsg, to see the difference.

你肯定会从这本书中受益,而 ZeroMQ 会给你许多你永远不会(相信我永远不会)准备好自己从头开始编程的能力.力量是如此巨大(如果再利用得好).

You will definitely benefit from this book and ZeroMQ will give you many powers you would never ( and believe me never ) would be ready to program from scratch on your own. The power is so immense ( if well re-used ).

注意

对于现实世界的进程间通信,有一个小问题需要注意.各种 ZeroMQ 版本的互操作性.是的,ZeroMQ 的力量是巨大的,然而,有必要在您的消息传递层中保持版本控制,以解决某些平台没有可用更新"版本的更新路径的情况.通过重新集成带有组件的交易系统来解决这个问题,其中需要 zmq.__version__ == 2.1.11,而最近的版本远高于 14.xy,以保证100%的端到端向后兼容.

For real-world inter-process communications, there is one minor issue to be aware of. Various ZeroMQ versions' inter-operability. Yes, the power of ZeroMQ is immense, nevertheless, it is necessary to keep the version control built in your messaging layer so as to solve situations, where some platforms do not have an update-path to "newer" releases available. Went into this issue with re-integration of a trading system with a component, where as old as zmq.__version__ == 2.1.11 was necessary, while recent are versions well above 14.x.y, so as to be assured to be 100% end-to-end backward-compatible.

尽管如此,整体潜力如此巨大,坚持并完成工作是有意义的.总帐.

Still, the overall potential is so immense, it makes sense to persevere and get the job done. G/L on that.

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

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