skelterjohn / rerun

Will autobuild and kill/relaunch the target when you update the code.
Other
258 stars 40 forks source link

Support tcp connect as an alternative to local filesystem watching #25

Open lox opened 9 years ago

lox commented 9 years ago

A common development environment (at least under OSX) is to use a virtual machine to run a development environment and use NFS or another network filesystem to mount your code locally for editing.

The issue with this and reloaders like rerun is that notifications don't pass over NFS. This is a common problem documented in the ruby listen gem, which provides a basic protocol for forwarding generic filesystem change events over TCP.

What this pull request implements is a -connect option that connects to a TCP event stream, and uses these events instead of watching for local events.

Consider this scenario:

host1> listen --forward :4000 -d .  
host2> rerun -connect host1:4000 github.com/lox/exampleapp

Rerun connects to the server that listen starts, and when files change on host1, they are passed to host2 to trigger a reload. Because the filesystems are shared over NFS between the hosts, the changed code is there.