diff libervia/server/tasks/task.py @ 1260:6161076193e0

tasks: dir event filter: if a Task instance implements `onDirEvent`, it will be called instead of `start`, this way the task can filter the events or modify the workflow.
author Goffi <goffi@goffi.org>
date Sun, 03 May 2020 21:07:22 +0200
parents 079e8eb6e327
children a46d0e0f383b
line wrap: on
line diff
--- a/libervia/server/tasks/task.py	Sun May 03 19:32:20 2020 +0200
+++ b/libervia/server/tasks/task.py	Sun May 03 21:07:22 2020 +0200
@@ -31,6 +31,8 @@
     ON_ERROR: str = "stop"
     LOG_OUTPUT: bool = True
     # list of directories to check for restarting this task
+    # Task.onDirEvent will be called if it exists, otherwise
+    # the task will be run and Task.start will be called
     WATCH_DIRS: Optional[list] = None
 
     def __init__(self, manager):