comparison 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
comparison
equal deleted inserted replaced
1259:0b269d4a46a3 1260:6161076193e0
29 """Handle tasks of a Libervia site""" 29 """Handle tasks of a Libervia site"""
30 # can be "stop" or "continue" 30 # can be "stop" or "continue"
31 ON_ERROR: str = "stop" 31 ON_ERROR: str = "stop"
32 LOG_OUTPUT: bool = True 32 LOG_OUTPUT: bool = True
33 # list of directories to check for restarting this task 33 # list of directories to check for restarting this task
34 # Task.onDirEvent will be called if it exists, otherwise
35 # the task will be run and Task.start will be called
34 WATCH_DIRS: Optional[list] = None 36 WATCH_DIRS: Optional[list] = None
35 37
36 def __init__(self, manager): 38 def __init__(self, manager):
37 self.manager = manager 39 self.manager = manager
38 40