Merge lp:~mvo/go-dbus/dbus-service into lp:go-dbus/v1
Status: | Needs review |
---|---|
Proposed branch: | lp:~mvo/go-dbus/dbus-service |
Merge into: | lp: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:~mvo/go-dbus/dbus-service |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Go D-Bus Hackers | Pending | ||
Review via email: mp+245736@code.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(
"""
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.
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