Open mike1158 opened 5 years ago
Think this is a very good idea.
Do you think you might be able to create a PR with some additional methods for querying the status ?
https://pypi.org/project/pid/3.0.3/ adds support for retrieving the numeric pid value from PidFileAlreadyRunningError exception.
It would be nice to add some better API support for querying the process status.
For example, if there is no extant pidfile, the .check() method throws an IOError due to lack of write access. I suppose this could be interpreted as "file does not exist", but it's not very clear.
It would also be nice to be able to get access to the numeric pid if it exists. As it is now, if a process is already running, calling .check() throws an exception. The error message does contain the pid of the running process, but unless I'm missing something, there's no way to access it without parsing it out of the error message.