gflohr / anyevent-filesys-watcher Goto Github PK
View Code? Open in Web Editor NEWMonitor file system changes in an AnyEvent event loop.
License: Other
Monitor file system changes in an AnyEvent event loop.
License: Other
All watcher objects seem to have cyclic references. The problem is that the callbacks for AnyEvent
reference the AnyEvent::Filesys::Watcher
instance.
The backend for macOS uses the interval
constructor option for the latency but they have different purposes. The interval
option determines the frequency for file system polls, whereas the latency
option gives the fseventd on macOS the opportunity to merge events. The default interval of 1 s is probably too high as a default latency. 0.1 s seems to be a better default latency.
See $title!
Does _postprocessEvents()
really get executed?
Backends that can parse events themselves should always do so. The marginal differences in the events reported are irrelevant for practical purposes.
Are they all needed?
It should be possible to pass a single directory as a scalar to the constructor.
In the vast majority of cases, you want to ignore (exclude) files and not filter (include) them. This would be an incompatible change unless the two options are mutually exclusive or can be combined.
A lot of getters are completely unnecessary:
directories
callback
interval
filter
parseEvents
skipSubdirectories
If only the backends use them, turn them into protected methods.
Falling back to the fallback module if the os-specific backend could not be loaded, was a bad idea, revert it. If somebody wants to use the module without a backend, it is always possible to install with --force
.
With Corion/Filesys-Notify-Win32-ReadDirectoryChanges#2 being fixed, that should also be supported by AnyEvent::Filesys::Watcher::ReadDirectory::Changes.
The deletion event is delivered after the test timeout fires.
Use GitHub Actions for automated testing. I currently do not have access to an MS-DOS machine.
The constructor should support an option raw_events
with a callback argument. This callback should be called with the raw events returned by the os-specific backend. That will allow integrating the backend into AnyEvent
, resp. os-specific optimizations for users of the library.
In general, I don't like cryptic abbreviations like cb
for a callback. Therefore, I had renamed the constructor arguments cb
and dirs
to callback
and directories
respectively. But this is maybe annoying for users of other modules from the AnyEvent
namespace because the callback parameter is always called cb
there. Best solution: Allow both, with callback
having
precedence.
Currently, the support for cygwin is just guesswork.
It just matches against /ignoreme
. But the string ignoreme
can occur as the random part of the temporary file name. The regular expression has to be anchored.
The current implementation is cumbersome in terms of OO design. There should be a WatcherFactory
that creates Instances of AnyEvent::Filesys::Watcher
according to the OS or the value of the selected backend in the constructor.
Backends should always pass on all constructor options to the backend module. That would make it possible to pass - for example - watch_root
or ignore_self
to Mac::FSEvents
.
The backend for MS-DOS currently uses a timeout to regularly poll for events. Use a pipe instead.
Since macOS 10.7 (Lion), the FSEvents framework allows monitoring not only directories but all files. On these systems, that feature should be used because it avoids the gratuitous filesystem scan.
Update po file and translate it.
If the dependencies for the specialized backends FSEvents
, Inotify2
, and KQueue
are not available, the module should fall back to the Fallback
module, maybe with a warning.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.