Skip to content
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

Add feature to clear notifier processes #210

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oliveroneill
Copy link

I have a use case where I'd like to keep notifier processes running while the application is running, so that they work for the duration of the application. The issue with long timeouts is that they will block the exit of a node program until it reaches the timeout. To fix this I've added a clearAll function that will clear the notifier processes. This fixes node programs from being blocked by the terminal processes on exit.

Currently I've only done this for terminal-notifier, I can make this change for the other platforms however I don't have a proper way to test them.

@mikaelbr
Copy link
Owner

mikaelbr commented Nov 5, 2017

Hi! Thanks for the PR!

What do you mean with

so that they work for the duration of the application
here?

Why do you want to have the processes running?

@oliveroneill
Copy link
Author

If you create a notification that opens a URL, once it reaches timeout then clicking on it does nothing. I'd like the notifications to keep working for as long as possible. If there's a better way to do this, I'd love to know.

@mikaelbr
Copy link
Owner

mikaelbr commented Nov 5, 2017

Did you try this with the master branch and wait option? I think I recall some changes being made with terminal-notifier and proper timeout management (which it didn't have previously).

@oliveroneill
Copy link
Author

I did. It looked like it was still timing out, and the documentation says that this is equivalent to setting the timeout to 5 seconds. I know terminal-notifier recently added the ability to turn off the timeout so that it waits indefinitely. Which is the feature that I'd like to use, but it requires some way of killing the process later. Hence this pull request.

@mikaelbr
Copy link
Owner

mikaelbr commented Nov 5, 2017

Is it a flag that should be added to the options to make the indefinite wait happen, or is it just the timeout flag as true?

@oliveroneill
Copy link
Author

If you don't include the timeout option then it will just block forever. Even without blocking forever, if the developer sets a long enough timeout then they won't be able to exit their application till it reaches the end of the timeout.

For example, if you had a command line tool that sent a notification, then did some long running task and then exits at the end. If the long running task finishes before the notification times out then the program will block until the timeout. It would be useful if the program could just stop all the notifications when it's finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants