How it works
- Your application receives a service notification or checks for changes.
- It reports each change to Mirage with
ws.notify(). - The agent receives it through
ws.events().
ws.events() alone does not start a file watcher or check the service.
Listen for changes
Here,ws is your workspace with a VFS connected at /data. This listens for
changes anywhere under that path:
report.csv, the listener prints:
Output
update means the existing file’s contents or metadata changed.
To listen to fewer files, change the path:
Notification types
Each notification includes the virtual path and what happened:Connect your VFS
- Push: Receive changes from a webhook, stream or external file watcher. See the Disk, S3 and GitHub examples.
- Poll: Fetch changes from a service. See the Dropbox, Box and Google Drive examples.
ws.notify().