23

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.

jldupont
  • 93,734
  • 56
  • 203
  • 318

4 Answers4

23

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

Community
  • 1
  • 1
MKroehnert
  • 3,637
  • 2
  • 34
  • 43
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.

Oluwafemi Sule
  • 36,144
  • 1
  • 56
  • 81
mipadi
  • 398,885
  • 90
  • 523
  • 479
4

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

jldupont
  • 93,734
  • 56
  • 203
  • 318
Paul R
  • 208,748
  • 37
  • 389
  • 560
  • 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 Apr 27 '10 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 Apr 27 '10 at 19:10
  • thanks for the clarification. +1 for pointing me in the Mach Port direction... didn't know about those. – jldupont Apr 27 '10 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 Apr 27 '10 at 19:18
-3

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

Joe Holloway
  • 28,320
  • 15
  • 82
  • 92
stwissel
  • 20,110
  • 6
  • 54
  • 101
  • 2
    MacPorts is the correct source for this: http://www.macports.org/ There is a long and contentious history between the real MacPorts project and the DarwinPorts scraper. – Matt K Mar 29 '11 at 13:47