-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug? Process not terminating #69
Comments
The bus runs in the background to process dbus messages. If you want it to stop, use |
Thanks for the quick reply! I was looking for something like this, but trying it like this 'use strict'
const dbus = require('dbus-next')
const bus = dbus.systemBus()
bus.disconnect() throws
It looks like something is still using that bus? But I have literally just reastarted my computer before I tried this and the example is as simple as I posted it here. Is it intended that the bus is running forever? I haven't found any info on this in your examples. Cheers |
You've run into the unusual case of disconnecting a bus that hasn't connected yet. That's a bug I need to fix.
Yes |
:-D okay. So I have to put some sleep in between to fix this :-D This actually works :-) 'use strict'
const dbus = require('dbus-next')
const bus = dbus.systemBus()
setTimeout(() => {
bus.disconnect()
}, 1000) If this is intended, you should mention the need for explicitly calling disconnect() in the docs. I couldn't find anything about it in the examples and even the api docs don't say much about the importance of disconnect. For me it is unexpected that it is intended that bus never terminates and thus needs to be terminated explicitly. But I'm beginning to understand the reasoning behind it and I think my approach of working with the MessageBus is wrong... |
Is this error I just got in any way related to the fact that dbus-next keeps connections open?
I'm using Where should I put 'use strict'
const dbus = require('dbus-next')
class DBusObject {
constructor () {
this.bus = dbus.systemBus()
}
}
module.exports = DBusObject All classes use Is there a better approach to do this? Should I connect to the bus and disconnect from it in every method call? |
Creating a bus is a heavyweight operation. You should only have one MessageBus for your whole application. |
So I should make it a global? I actually expected that Do you know any real application based on |
This library was originally written for mpris-service. The test suite was written to show how I intend to use the library. For other examples, use Github search. https://github.com/search?p=1&q=dbus-next+language%3AJavaScript+language%3ATypeScript&type=Code |
Hey,
if I initialize a system or session bus, the program won't terminate.
When I run it on the terminal like this, it will run forever:
I have to use Strg+C to terminate it.
Those are the versions I'm using:
As I couldn't find any information that dbus needs to be closed/terminated/unset in some way, I assume that this is a bug.
I started to use dbus-next just a couple of days ago (when 0.9.2 was already released) but I still think that I didn't have this issue yesterday :-P But I'm not certain and I have no idea what could have introduced the issue.
Any ideas what's going on here?
Cheers
Fred
The text was updated successfully, but these errors were encountered: