-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
How to deactivate listener? #23
Comments
checking with |
Hi, I reopen this, since I still have issues. What I am trying to do, is have a program that allows the user to configure an DToverlay via a GUI that is then installed and the program uses input-event to register events to read from the DTOverlay. It looks, like there is still a reference to the particular device and thus dtoverlay generates the error. const log = require('why-is-node-running');
const InputEvent = require('input-event');
var input = new InputEvent('/dev/input/event0');
setTimeout(()=>{
console.log('Removing input ')
input.close(()=>{
input=null;
});
},2000);
setTimeout(()=>{
log();
},10000) This gives me the following output (the timer handler is from the 10s timer calling
Any ideas? |
I dug a bit deeper: This is the line in
So it seems to be the listener attached to the fs.ReadStream object. |
Hi,
thanks for this little project. I use it to drive multiple rotary encoders and it is really working very nicely.
I noticed one thing:
When a listner is registered with
on
(like in the example you provide), I would like to also unregister it again. Normally, I often useoff
for that purpose, but that seems not to work. So I usedremoveAllListeners()
instead.But I noticed, that the program does still not finish, which seems to indicate, that it still waits for input. Even if I call close on the objects and even set them to null, it does not stop executing until I press
Ctrl+C
.I basically add this code to the end of the example you provide:
The text was updated successfully, but these errors were encountered: