Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Polling a file for changes - Best Practices?

by Your Mother (Archbishop)
on Mar 05, 2020 at 00:12 UTC ( [id://11113800]=note: print w/replies, xml ) Need Help??


in reply to Polling a file for changes - Best Practices?

Caveat: I am not adept at this despite doing some lately. The main reason I succeeded was haukex’s help. That said, my first impression would be what you say, a websocket doing tail. I would read the the process from tail -F through a pipe—with one of the IPC:: modules probably but I’d have to read a few nodes to remember which is best here—and just loop through $x lines or bytes, throwing them away if there is no client, and sending the pipe stream output to any connected clients in close to real time.

I am too lazy / pretend-busy tonight to try to hack something up for you, despite wanting a log tailer just like this for a couple of years, but here are some nice code jumping off points: Mixing asynchronous data feed with synchronous program flow control (replies) and tail file and websocket stream and Re: Architecture advice, proxy or rebroadcast websocket.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11113800]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-29 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found