Merge lp://staging/~mvo/go-dbus/dbus-service into lp://staging/go-dbus/v1

Proposed by Michael Vogt
Status: Needs review
Proposed branch: lp://staging/~mvo/go-dbus/dbus-service
Merge into: lp://staging/go-dbus/v1
Diff against target: 204 lines (+183/-1)
3 files modified
dbus.go (+1/-1)
service.go (+87/-0)
service_test.go (+95/-0)
To merge this branch: bzr merge lp://staging/~mvo/go-dbus/dbus-service
Reviewer Review Type Date Requested Status
Go D-Bus Hackers Pending
Review via email: mp+245736@code.staging.launchpad.net

Description of the change

This branch adds a new DBusService helper that can be used to export a existing type over dbus. Its loosely modeled after the python dbus way of exporting objects.

The idea is that you can simply do:
"""
type Impl struct {
}
func (m *Impl) Something() error {
 return nil
}
ser := NewDBusService(dbus.Connect(dbus.SessionBus), INTERFACE, OBJECT_PATH, BUS_NAME, impl)
"""
and this makes it possible to call Impl.Something() over dbus.

This diff is mostly meant to start a discussion if this is the right approach. If you guys like it the error checking of the reflect code needs to be improved, the test needs to test for various error conditions (wrong parameter count, wrong types etc) and it would be nice if it would generate introspect data automatically for the dbus introspection interface.

In r135,136 it also contains a testcase and a fix for a hang that can happen when a dbus method sends a signal with a active watcher before the reply of the method is send.

To post a comment you must log in.

Unmerged revisions

136. By Michael Vogt

dbus.go: fix previous hang by running the watcher callbacks in a go routine

135. By Michael Vogt

add FAILING test (it hangs) that shows how go-dbus hangs when a method is sending a Signal in the dbus message before sending a reply msg

134. By Michael Vogt

Add DBusService wrapper

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: