scf37 / hottie Goto Github PK
View Code? Open in Web Editor NEWAutomatic hot reloading of Scala classes
Automatic hot reloading of Scala classes
From what I can tell, Hottie uses filewatch to watch files. Unfortunately, the default jdk watchservice on osx is a slow polling service. I wrote a cross platform file tree cache library that is somewhat similar to filewatch: swoval-files. Funnily enough, I started out writing a plugin that overrides the default sbt watch implementation ala
sbt-overwatch (sbt-closewatch). At any rate, the swoval-files library is now used by sbt to implement ~
. If you were to switch to using that library instead of filewatch, you'd get good osx performance for free (it also has been extensively tested on linux, windows and freebsd).
The PathWatcher
interface is very similar to the watch interface that you provide in filewatch. If you are willing to use more memory, you can use the FileTreeRepository
interface which caches portions of the file system in memory. Each cache entry has an associated value that is computed more or less by invoking a function from Path => T
for some type T. The FileTreeRepository
interface allows you to add an arbitrary number of observers that will receive callbacks whenever a file under monitor changes. Because we cache the value, there is an update callback that provides both the current and previous value of the cache value. You can use this to avoid triggering a re-compile if a source file is touched but not actually modified. I provide an example of this in the readme that uses the last modified time as the cache value, but it could just as easily by, say, the md5sum of each file.
Also, sbt 1.3 is very likely to introduce a new task called watch that has the same semantics as ~
. This new task will be highly configurable wrt what files it monitors and how it reacts to user input and file events. Hottie seems like it would be a great sbt plugin. I will be writing up full documentation of this new sbt functionality soon.
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.