gws.server.monitor

Source code: gws.server.monitor

Module Contents

class gws.server.monitor.Object

Bases: gws.ServerMonitor

File Monitor facility.

dirs: list
enabled: bool
files: list
frequency: int
tasks: list[gws.Node]
taskTime: int
watcher: gws.lib.watcher.Watcher
watchPaths: set[str]
configure()

Configuration hook.

register_periodic_task(obj)

Register an object as a periodic task handler.

Parameters:

obj – A node with a periodic_task method.

schedule_reload(with_reconfigure=False)

Schedule a system reload.

Parameters:

with_reconfigure – Reconfigure the server before reloading.

start()

Start the monitor.

watch_directory(dirname, pattern, recursive=False)

Add a directory to watch.

Parameters:
  • path – Directory path.

  • pattern – Regex pattern for files to watch.

  • recursive – Watch subdirectories.

watch_file(path)

Add a file to watch.

Parameters:

path – File path.