Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example of new PollWatcher compare_contents feature
The example shows how to use this to effectively watch pseudo filesystems like those through sysfs (i.e. /sys/). The example by default will only work on Linux but does demonstrate well that it works where the previous metadata only approach would not. Sample output: Trying "/sys/class/net/lo/statistics/tx_bytes", use `ping localhost` to see changes! watching ["/sys/class/net/lo/statistics/tx_bytes"]... changed: Event { kind: Modify(Data(Any)), paths: ["/sys/class/net/lo/statistics/tx_bytes"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None } changed: Event { kind: Modify(Data(Any)), paths: ["/sys/class/net/lo/statistics/tx_bytes"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None } changed: Event { kind: Modify(Data(Any)), paths: ["/sys/class/net/lo/statistics/tx_bytes"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None } changed: Event { kind: Modify(Data(Any)), paths: ["/sys/class/net/lo/statistics/tx_bytes"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }
- Loading branch information