Regarding Stop Method
Closed this issue · 2 comments
beyondgrayzone commented
If I understand correctly, Stop
method on the pipeline
stops listening for events. Then why in the example is it called in defer
? Shouldn't it be called by some command line action?
dshills commented
That is implementation specific. It could be written to call
go p.Start()
... wait for signal
p.Stop()
To simplify the example I don't run the pipeline as a gofunc or check for a signal. I just kill the app ^c. Stop() turns off the listener and closes the channels. Not sure it is actually necessary because I haven't read every line in fsnotify or fsevents but better safe than sorry. That is why I added the defer line.
beyondgrayzone commented
Thanks