Hi Gary, On Tue, 22 Nov 2016 10:25:25 +0000 Gary Stainburn <gary.stainb...@ringways.co.uk> wrote:
> This is a request for opinions rather than an answer to a problem. > > I'm looking to write a daemon that can sit on my Domoticz (home automation) > server and can respond to Domoticz events and can receive commands to run > tasks that would otherwise block the server. > > These will include things like > 1) Turn a LED on or off - straight forward command > 2) flashing a LED (timer event), > 3) run a wake-up sequence (slowly fade up a lamp, turn on the radio - stop if > I click OFF) (timer event), > 4) run external commands without blocking (squeezy to control a Logitech > Media Server) > > I'm looking at using a named pipe for sending commands, and also a tail -f to > monitor the Domoticz log file so I can respond to device state changes. > Listening on a socket could be a nice to have too. Aside from named pipes there are also unix-domain sockets and TCP sockets, both of which are more robust. > > I've previously used File::Tail for log file monitoring and Net::Telnet for > remote command execution, both of which look useful. Theu should be OK. > > I've had a quick look at AnyEvent as the core for my app and it looks simple > enough for me to understand. I've also looked briefly at POE which looks more > comprehensive, but more complex. > Last time I checked, AnyEvent erred if IO-Async which is a different alternative was also used, causing some people to avoid using AnyEvent. I ended up sticking with AnyEvent for https://metacpan.org/release/App-ManiacDownloader because IO-Async's support for FTP was lacking. Also see the page I wrote here - http://perl-begin.org/uses/multitasking/ . There's also https://metacpan.org/release/Reflex which I think is a Moose-based rethinking of POE . > What do people think is my best way forward? > Seems like you are on the right track. Shlomi -- ----------------------------------------------------------------- Shlomi Fish Microsoft — making it all make sense. Ours. Please reply to list if it's a mailing list post -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/