in reply to Re: Implementing AnyEvent::Ping multiple times
in thread Implementing AnyEvent::Ping multiple times
Thanks for the reply, sorry if this seems confusing.
This is my first go at using event loops so I am slowly grasping the concepts and how to implement it, but i'm struggling a little, so I'm not even sure if i'm doing this properly. The main reason I started with this, was to develop a simple perl ICMP monitoring plugin for another application that would be able to ping different sets of many hosts, very quickly, across different, possibly overlapping schedules. E.g 192.168.1.x every 2 minutes and 192.168.2.x every 5 minutes. I've tried various methods and the AnyEvent::Ping module seems to be the best option for performance for asynchronous. To answer your questions:1. I used IO::Async::Timer::Periodic to give me an extra option on scheduling the code execution. I didn't realise that i needed AnyEvent::Impl::IOAsync, i've done some more reading and understand this now, so thanks.
2. This is just test code, so in reality the intention is to invoke AnyEvent::Ping on different sets of hosts and different schedules, however I'm not sure how I get around the fact that AnyEvent::Ping is blocking. I just didn't bother to create another subnet as I'm still trying to understand how I will get this to work. So just ignore that for now.
3. Yes I'm aware of that, thats me testing on how the reschedule option in Periodic works, i.e. the ping bomb you're talking about, so just ignore that for now. If this is not the best approach to achieve this then I'm open to alternatives. I also looked at using Threads but its very CPU/memory intensive compared to AnyEvent::Ping. I'm testing this on Windows using Strawberry Perl if thats relevant.
Thanks! Mike
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Implementing AnyEvent::Ping multiple times
by hippo (Archbishop) on Jun 12, 2020 at 09:30 UTC | |
by mmoorreett (Acolyte) on Jun 14, 2020 at 07:45 UTC |