Looking for advice on how to best accomplish this in 2020. The last node I could find mentioning polling files was from 2004.
Rationale: I have a log file I want to tail out to the browser via Mojolicious websockets. I have a rudimentary solution in place where an XHR request is sent on a 10 second interval to the server (client pull) which then goes and checks for updates a la qx(tail -n50 $file) ... basically.
Having seen how awesome websockets can be, I want to use a sever-push model instead. The websockets logic is already in place... I just need to know how best to approach the file polling. Something like d/inotify maybe? Or stat() wrapped in a while loop (yuck)?
Thoughts??
In reply to Polling a file for changes - Best Practices? by Tommy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |