-
Notifications
You must be signed in to change notification settings - Fork 22
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
Detect is emitter already running #32
Comments
@ArmorDarks You sure could. Most unix init scripts do just that. (edge cases, but alas!) Log the process ID of the emitter (or perhaps the parent in which launched it, however you prefer) to a file after forking the chokidar emitter. future executions simply involve a check against this logged PID to decide whether or not to fail and terminate before a further launch. |
@i8degrees Thanks! Though, wow, that sounded slightly more complicated than it should be... Anyway, I guess this library isn't maintained anyway, so there little chances that it will be extended or a PR will be accepted, right, @capaj? |
@ArmorDarks I haven't touched this codebas in quite a while, but I will certainly merge a PR if you make it well. Feel free to update dependencies as well while you're at it. |
@capaj Thanks for the reply! I'll try to investigate how to do this since I do not have a clear picture yet. @i8degrees give me a good path to watch, but still, there are some things to be figured out... |
@ArmorDarks nods I thought the same myself for many years! It is actually a rather clever, simple design that is proven the test of time.
I kept this list short, so to try a gentle introduction. You will often find in OSS server distributions a contrib directory that contains process scripts for various platforms. This would be an excellent place to start looking for reference implementation details. Sorry, no distribution name comes to mind, but you'll find a plethora in FreeBSD ports. Good luck! P.S. Remember, what is important (generally speaking, perhaps not in your case?) are emitters that you depend on, so that you can keep from touching third-party emitters that may be running. This is one reason how PID lists can be nice. |
The necessity of disk operation is no-go for me since it will impact our build system performance, which means the harder time during development. But thanks for the lead, I will look into it. |
Thanks for the lib!
I wonder, is it possible somehow to detect is emitter already running? Or make so that invoking emitter second time (when it is already running) will not fail and simple ignore invocation?
The text was updated successfully, but these errors were encountered: