RFC: arg0array= matches

Lennart Poettering <[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <20150429141059.GA8684@gardel-login>
Heya,

I'd like to add a new match expression "arg<n>array=" to dbus. It
would work like "arg<n>=" but test a string against an array of
strings. 

The usecase for this is this: we'd like to move udev to use dbus as
transport. To make this efficient we need a way to match device
announcements. One of the most common matches in old udev was to
subscribe to all devices that carry a certain "tag", where "tag" is a
short string that devices can be labelled with. A typical device may
carry 0, 1 or more tags, and they are included as a list in each
announcement message. 

Example: let's say we send out NewDevice signals each time a new
device appears, and NewDevice contains as first parameter the tags of
the device, followed by some more stuff, then we could install the
following match from a client that wants to get notified of all
devices tagged with the tag "seat7" (which is a tag that logind tags
devices belonging to a seat "seat7" with):

       type='signal',sender='org.freedesktop.devices1',interface='org.freedesktop.devices1.Manager',member='NewDevice',arg0array='seat7'

The signal would then have a signature starting with "as". A signal
sent out with ["foobar", "waldo"] as this string array would not be
matched by the expression. A signal with ["miau", "kikiriki", "seat7",
"wuffwuff" ] otoh would match.

The syntax "arg0array=" takes inspiration from the match types
"arg0path=", "arg0namespace=".

Before I cook up a patch for the dbus spec for this, any opinions on
this?

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
dbus mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.