Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the possibility of scheduling a periodic idle event #84

Closed
philpraxis opened this issue Jun 15, 2015 · 4 comments
Closed

Add the possibility of scheduling a periodic idle event #84

philpraxis opened this issue Jun 15, 2015 · 4 comments
Milestone

Comments

@philpraxis
Copy link

In some application (mine right now), it may be useful to have fswatch generate an event (empty line, heartbeat or else) every X seconds even if there is no activity on the monitored files

-T (Timeout) or -A (Artificial) ?

Thanks.

@jsarenik
Copy link

Is timeout from Coreutils enough for you?It sounds like it offers the same functionality and can be easily stacked as timeout 10s fswatch ...

@jsarenik
Copy link

The heartbeat event can be possibly achieved using pgrep or ps because fswatch should be running if it operates and if there is an error, it exits and you would not find a process running.

For example:

while pgrep fswatch >/dev/null
do
  echo "fswatch heartbeat"
  sleep 1
done

@JLarky
Copy link

JLarky commented Jan 9, 2016

timeout option would be very useful, but if you are looking for ways to emulate it in bash, you can look at script I wrote https://gist.github.com/JLarky/8a4033688d516ac9a5d6 basically idea is that I have separate process timeout that touches file TIMEOUT_TMP_FILE after some time and I have fswatch to watch for both desired directory and this TIMEOUT_TMP_FILE.

Keep in mind, that in my script I don't reset timeout after I get output from fswatch, if you need that you would have to add this functionality by yourselves.

@emcrisostomo
Copy link
Owner

I'm thinking about adding this feature to the pipeline shortly. To keep things simple, I'm thinking about having fswatch generate the heartbeat always, even if change events were detected between two consecutive heart beats. Any feedback on this?

@emcrisostomo emcrisostomo added this to the 1.9.0 milestone Feb 6, 2016
@emcrisostomo emcrisostomo changed the title Add a timeout or artificial event every X seconds Add the possibility of scheduling a periodic event Mar 27, 2016
@emcrisostomo emcrisostomo changed the title Add the possibility of scheduling a periodic event Add the possibility of scheduling a periodic idle event Mar 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants