Skip to content

Replace radovskyb/watcher with fsnotify/fsnotify - #2124

Open
Seanstoppable wants to merge 1 commit into
wtfutil:trunkfrom
Seanstoppable:seanstoppable-replace-watcher-with-fsnotify
Open

Replace radovskyb/watcher with fsnotify/fsnotify#2124
Seanstoppable wants to merge 1 commit into
wtfutil:trunkfrom
Seanstoppable:seanstoppable-replace-watcher-with-fsnotify

Conversation

@Seanstoppable

Copy link
Copy Markdown
Collaborator

Replace the polling-based radovskyb/watcher (54 open issues, slow maintenance) with fsnotify/fsnotify which uses native OS file system events for better performance and reliability.

Changes

  • app/wtf_app.go — Config file watcher now uses fsnotify's event-driven API instead of 100ms polling
  • modules/textfile/widget.go — Textfile widget watcher similarly converted
  • go.mod/go.sum — Added fsnotify/fsnotify v1.10.1, removed radovskyb/watcher

Notes

  • fsnotify starts watching immediately on Add() — no Start() call needed
  • Write events are filtered in the event loop via event.Has(fsnotify.Write)
  • Channel close detection replaces the old watch.Closed channel pattern
  • No behavioral changes to end users; file change detection is now instant rather than polling-based

Replace the polling-based radovskyb/watcher library with fsnotify/fsnotify
which uses native OS file system events. This provides better performance
and reliability for config and textfile change detection.

Changes:
- app/wtf_app.go: Use fsnotify for config file watching
- modules/textfile/widget.go: Use fsnotify for textfile watching
- go.mod/go.sum: Add fsnotify, remove radovskyb/watcher
@Seanstoppable
Seanstoppable force-pushed the seanstoppable-replace-watcher-with-fsnotify branch from b671275 to f0abc2d Compare July 23, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant