go-fsnotify/fsevents — pull request #3 by samjacobson (2014-11-15 04:43:19+00:00)
Title: remove stop, invalidate, release from the API (just use Close)

This probably needs some discussion, but it seems like a trap to export Stop, Invalidate, and Release (at least the way the code works at present). These functions need to be called in the right order, and I don't think it'll do the right thing if you call Stop then Start again (will probably leak a thread/runloop).

This commit just changes stop, invalidate, and release to be internal functions. They're not used by the test code in watcher_test.go (it calls New, Start, Close just like all clients of this code should).

I'm not sure what is more idiomatic, but perhaps the Stream should be auto-started, i.e. call New then Close when you're done. Or, alternatively, support New, Start, Stop, Close but make sure you can call Stop,Start without leaks (and Close automatically calls Stop).

Thoughts?