Code Monkey home page Code Monkey logo

rxfilewatcher's Issues

The FileSystem of the configured Path is not used

A Path for a non-default FileSystem might be used for creation yet the created observables assumes it can watch from FileSystems.getDefault(). The FileSystem from the supplied Path should be used.

Registration should not happen until subscribe

Currently registration of directories happens in the constructor of ObservableFactory. This is incorrect as the observables being created are cold, not hot. Registration should be deferred until subscription happens.

Class and method naming

The name of DirectoryObservable in the context of RxJava messages that it is a subclass of rx.Obserable and also that instances of it will be used by consumers (like ConnectedObservable, BlockingObserable, etc.) yet neither is true.

I would suggest changing the name to PathObservables. Path is the subject of the observables being created and the plural of Observable indicates its a utility class with static methods. As to the method names, using something like watch and watchRecursive describe the implementation of the observable which takes the subject (Path) as an argument.

Option to add/remove path after creating

The problem here that per one instance of this we can track single directory(+recursive). So If the amount of tracking candidates vary during program lifecycle, it appears that per each I need create new Instance that will ate another thread.
But we can utilize existed thread that already created during previous instances.
And no, I am not asking for single thread per all, as this may cause StandardWatchEventKinds.OVERFLOW. Many threads is good. 1 thread per 1 folder - not so good. So having some way to alter existed watchers by adding/removing targets is best option.

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.