Option to monitor a service source file and restart on change #30

Closed
opened 2018-06-30 00:08:19 +00:00 by jamie · 7 comments
jamie commented 2018-06-30 00:08:19 +00:00 (Migrated from git.hazaar.io)

This would be brilliant in a development environment or when updating code. I know there are ways in PHP to monitor when a file changes and capture signals. This could be done inside the Warlock\Service abstract class and shutdown with an exit code that triggers a nice restart (ie: doesn't get counted as a error restart).

This would be brilliant in a development environment or when updating code. I know there are ways in PHP to monitor when a file changes and capture signals. This could be done inside the Warlock\Service abstract class and shutdown with an exit code that triggers a nice restart (ie: doesn't get counted as a error restart).
jamie commented 2018-07-12 01:25:59 +00:00 (Migrated from git.hazaar.io)

added ~163 label

added ~163 label
jamie commented 2018-08-07 11:40:21 +00:00 (Migrated from git.hazaar.io)

Here's a simpler idea.

  • Start the service.
  • Use reflection to get the filename the service class is defined in.
  • Record the file_mtime
  • After some period, check if the file mtime has changed and if so, exit with a code (ie: 6), which will cause the server to restart the service.
Here's a simpler idea. * Start the service. * Use reflection to get the filename the service class is defined in. * Record the file_mtime * After some period, check if the file mtime has changed and if so, exit with a code (ie: 6), which will cause the server to restart the service.
jamie commented 2018-08-07 11:41:27 +00:00 (Migrated from git.hazaar.io)
created branch [`30-option-to-monitor-a-service-source-file-and-restart-on-change`](https://git.hazaarlabs.com/hazaar/hazaar-warlock/compare/master...30-option-to-monitor-a-service-source-file-and-restart-on-change)
jamie commented 2018-08-07 11:41:28 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !11

mentioned in merge request !11
jamie commented 2018-08-07 12:42:13 +00:00 (Migrated from git.hazaar.io)

mentioned in commit a1394c1f4d

mentioned in commit a1394c1f4dafc00282c1f1eda49968b6d18c7ce3
jamie commented 2018-08-07 12:42:13 +00:00 (Migrated from git.hazaar.io)

closed via merge request !11

closed via merge request !11
jamie commented 2018-08-07 23:54:29 +00:00 (Migrated from git.hazaar.io)

mentioned in issue #24

mentioned in issue #24
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/hazaar-warlock#30
No description provided.