You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are right, the sample code is somehow "broken". Even though I wouldn't say broken, because it relied on a side effect caused by the sending thread-pool using non-daemon threads.
I think dbus-java should never block. I always hate libraries causing my applications to hang or to force me doing weird stuff to let it stop properly.
The user of the library should control when the application should block or terminate immediately.
If it should block: take care that is does by yourself and ensure a proper shutdown if the condition to stop is reached.
I therefore updated the example in the documentation and added the code as running example in dbus-examples module.
The updated example simple provides a way to close the application remotely using a CountDownLatch. Anyway, a application developer should replace that with something more suitable (allowing anyone to kill you application remotely is not a good idea most of the time).
The example in the Maven site documentation, https://hypfvieh.github.io/dbus-java/exporting-objects.html, no longer works correctly without changes. It simply exits immediately.
It appears this was broken by 7219193
A
Thread.sleep(999999)
does the trick, but is not ideal. I'm not sure what the right way to fix this would be.The text was updated successfully, but these errors were encountered: