Giter Club home page Giter Club logo

anyevent-filesys-watcher's People

Contributors

gflohr avatar

Watchers

 avatar

anyevent-filesys-watcher's Issues

Fix Cyclic References

All watcher objects seem to have cyclic references. The problem is that the callbacks for AnyEvent reference the AnyEvent::Filesys::Watcher instance.

Add Option `latency`

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.

Remove Option `parse_events`

Backends that can parse events themselves should always do so. The marginal differences in the events reported are irrelevant for practical purposes.

Ignore Files Instead of Filtering

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.

Public API too Big

A lot of getters are completely unnecessary:

  • directories
  • callback
  • interval
  • filter
  • parseEvents
  • skipSubdirectories

If only the backends use them, turn them into protected methods.

Remove Graceful Fallback

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.

Add Option `raw_events`

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.

Create Alias `cb` for Constructor Argument `callback`

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.

Filter in Test Cases is Unsafe

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.

Use Factory Pattern

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.

Allow Backend-Specific Options

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.

Use AE::io for MS-DOS

The backend for MS-DOS currently uses a timeout to regularly poll for events. Use a pipe instead.

Fail gracefully if Backend is not available

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.