boxlang-file-watcherslisted
Install: claude install-skill ortus-boxlang/skills
# BoxLang File Watchers
## Overview
BoxLang includes a runtime watcher service for real-time filesystem automation.
Watchers are ideal for:
- hot reload and development workflows
- build pipelines and asset regeneration
- file drop ingestion and ETL triggers
- reacting to create/modify/delete events
## Application.bx Integration
You can register app-scoped watchers directly in `Application.bx` with `this.watchers`.
For full descriptor behavior (app discovery, multi-app isolation, lifecycle), see
[`application-descriptor`](../application-descriptor/SKILL.md).
```boxlang
class {
this.name = "MyApp"
watcherListener = new app.listeners.HotReloadListener()
this.watchers = {
sourceWatcher : {
paths : [ expandPath( "./src" ) ],
listener : watcherListener,
recursive : true,
debounce : 250,
atomicWrites : true,
errorThreshold : 10
}
}
}
```
Supported watcher definition keys commonly include `paths`, `listener`, `recursive`, `debounce`, `throttle`, `atomicWrites`, and `errorThreshold`.
## Event Model
Event kinds:
- `created`
- `modified`
- `deleted`
- `overflow`
Listener payload struct keys:
- `kind`
- `path` (absolute path; blank for overflow)
- `relativePath` (relative to watcher root; blank for overflow)
- `watchRoot` (blank for overflow)
- `timestamp` (ISO-8601)
## Creating a Watcher
`watcherNew()` registers a watcher but does not automatically start it unless