Add feature to clear notifier processes#210
Add feature to clear notifier processes#210oliveroneill wants to merge 2 commits intomikaelbr:masterfrom
Conversation
|
Hi! Thanks for the PR! What do you mean with
Why do you want to have the processes running? |
|
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. |
|
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). |
|
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. |
|
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? |
|
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. |
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
clearAllfunction 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.