Refactor PollWatcher to make it clean for further develop.
This commit would not change any behaviors user observable (not include
Debug implementation) and public documentation.
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 }