gen2brain / beeep

Go cross-platform library for sending desktop notifications, alerts and beeps
BSD 2-Clause "Simplified" License
1.47k stars 90 forks source link

Use Run() instead of Start() to execute notification helpers #29

Closed muesli closed 5 years ago

muesli commented 5 years ago

Using Start() but not waiting for the command to complete will leave dangling defunct processes that can't be cleaned up until its parent dies.

15660 pts/15   Z+     0:00 [notify-send] <defunct>
16139 pts/15   Z+     0:00 [notify-send] <defunct>
16644 pts/15   Z+     0:00 [notify-send] <defunct>
...

Run() will wait for the command to finish, but cleans up after itself.

Alternatively, we could launch Start() in a go-routine and Wait() for it, but that complicates the error handling.