macos 是否有与 OSX 上的 DBus 等效的东西?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2723936/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there an equivalent to DBus on OSX?
提问by jldupont
Is there an equivalent to Linux DBus on OSX? I mean, is there a "message bus" available by default on OSX?
是否有与 OSX 上的 Linux DBus 等效的产品?我的意思是,OSX 上是否有默认可用的“消息总线”?
Disclaimer:OSX newbie here.
免责声明:这里是 OSX 新手。
采纳答案by mipadi
Probably the closest analog would be distributed notifications (or notifications for same-process communication). It's not a perfect analog, but it fits into roughly the same niche. You can read more about it in Apple's Notification Programming Topics, particularly the part about the distributed notification center.
可能最接近的模拟是分布式通知(或同进程通信的通知)。它不是一个完美的模拟,但它适合大致相同的细分市场。您可以在 Apple 的通知编程主题中阅读更多相关信息,特别是关于分布式通知中心的部分。
回答by MKroehnert
If you need to use DBus you can install it via Homebrew.
Homebrew is a package manager for OS X providing a lot of libraries which where mostly written with Linux as their primary target.
The DBus package can be found here
如果您需要使用 DBus,您可以通过Homebrew安装它。
Homebrew 是 OS X 的包管理器,提供了许多库,这些库主要以 Linux 作为主要目标编写。DBus 包可以在这里找到
However, this is not installed by default and if you intend to write Cocoa applications the way to go would be to use the (distributed) notification center as mipadi explained in his post(which you also accepted).
但是,这不是默认安装的,如果您打算编写 Cocoa 应用程序,则可以使用(分布式)通知中心,如 mipadi 在他的帖子中所解释的(您也接受了)。
If you need a robust middleware for communication you can also have a look at IceTouchfrom ZeroCwhich is a Cocoa library for using the services and functionality offered by their Ice framework. The package contains IceStormfor example which is a publish/subscribe server or the IceGridservice which can be used to build large scale distributed systems
如果您需要一个强大的通信中间件,您还可以查看ZeroC 的IceTouch,它是一个 Cocoa 库,用于使用其 Ice 框架提供的服务和功能。该包包含IceStorm例如它是一个发布/订阅服务器或IceGrid服务,可用于构建大规模分布式系统
回答by Paul R
There's Mach's ports, which will probably do what you need: http://en.wikipedia.org/wiki/Mach_(kernel).
有 Mach 的端口,它可能会满足您的需求:http: //en.wikipedia.org/wiki/Mach_(kernel)。
回答by stwissel
You could check DarwinPorts. It should include the dBus libraries.
你可以检查DarwinPorts。它应该包括 dBus 库。