Posted Jul 12, 2012 5:28 UTC (Thu) by slashdot (guest, #22014)
Parent article: Missing the AF_BUS
Why is a bus even needed?
Make it so that the server creates a UNIX socket with the same it wants to take, and the client connects to it.
One of those could be an enumeration/activation/etc. server (but not a message router!).
For multicast, do the same and connect to all message broadcasters, using inotify to notice when new ones come up; the publisher just sends to all connected clients.
ZeroMQ can automate most of this, if desired.
The only kernel support that might be needed is support for having unlimited size Unix socket buffers and charging that memory to the receiver, so that the OOM killer/rlimit/etc. kills a non-responsive multicast receiver rather than the sender.
A more sophisticated solution that doesn't duplicate the socket buffer for each subscriber would be even better, but probably doesn't matter for normal usage cases.
Alternatively, get rid of signals, and instead have a key/value store abstraction where you can subscribe to value updates: this way, if the buffer space is full, you can just end an "overflow" packet and the client manually asks for the values of all its watched keys.