reaganmcf / lightmon

A lightweight, cross-platform, language-agnostic "run code on file change" tool, inspired by Nodemon
GNU General Public License v3.0
15 stars 2 forks source link

fix: Kill previous exec process before spawning new exec process #35

Closed reaganmcf closed 3 years ago

reaganmcf commented 3 years ago

Closes #20

Before this fix, previous exec process would not be killed between restarts (either from rs or file changes). This means the process' would pile up over time and that is definitely not a good thing.

However, with this patch, the exec process sends the Child handle to the main event loop through a new channel where they get dealt with before the new exec process is spawned to take it's place.