25

Is there an equivalent to Linux DBus on OSX? I mean, is there a "message bus" available by default on OSX?

Disclaimer: OSX newbie here.

4 Answers 4

24

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

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).

If you need a robust middleware for communication you can also have a look at IceTouch from ZeroC which is a Cocoa library for using the services and functionality offered by their Ice framework. The package contains IceStorm for example which is a publish/subscribe server or the IceGrid service which can be used to build large scale distributed systems

12

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.

1
  • +1: this functionality gets me at least closer to where I want to be headed. Thanks!
    – jldupont
    Commented Apr 27, 2010 at 19:07
4

There's Mach's ports, which will probably do what you need: http://en.wikipedia.org/wiki/Mach_(kernel) .

4
  • hmmm... from a quick browse, it appears that "Mach Port" is really just an IPC without the higher level semantics of publish/subscribe... or am I mistaking?
    – jldupont
    Commented Apr 27, 2010 at 19:03
  • @jldupont: yes, Mach ports are just queues and are the lowest level of IPC in Mac OS X - there are various other IPC mechanisms built on top of these.
    – Paul R
    Commented Apr 27, 2010 at 19:10
  • thanks for the clarification. +1 for pointing me in the Mach Port direction... didn't know about those.
    – jldupont
    Commented Apr 27, 2010 at 19:13
  • @jldupont: you might want to look at things like Mach messaging, kqueue and notify, depending on what kind of level you want to do IPC at. Get Amit Singh's book if you're serious about this kind of stuff.
    – Paul R
    Commented Apr 27, 2010 at 19:18
-3

You could check DarwinPorts. It should include the dBus libraries.

1
  • 2
    MacPorts is the correct source for this: macports.org There is a long and contentious history between the real MacPorts project and the DarwinPorts scraper.
    – Matt K
    Commented Mar 29, 2011 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.