CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Realtime - Persistent - Event Based - Heartbeat Perl program

 



rhqureshi
New User

Aug 3, 2011, 3:22 AM

Post #1 of 4 (2484 views)
Realtime - Persistent - Event Based - Heartbeat Perl program Can't Post

Dear Forum Users,
My name is Rizwan Qureshi and I am new to this forum, not new to perl though. I love perl and have been able to solve all of my programmatic problems without anyone's help. But today I am facing a design problem.

I want to make a script which should generate a separate heartbeat (processing something after specific interval, interval will be different for every event) for every event that it receives. For example on start event, a DB value should be updated. Then it should keep updating the DB value after every tick on specified interval time until stop event is received.

This should happen separately for every event that it receives. So lets say if the program receives two different events it should be able to handle them simultaneously with different timing intervals, one should run every 30 second and another every 45 second until the stop event is received.

Launching a separate thread for every event is an option, but its not very good one because I expect to receive 10,000 events per second, So I dont want to exhaust the machine with too many threads.

All of your valuable suggestions and comments will be greatly appreciated. I badly need them.

Please help...


FishMonger
Veteran / Moderator

Aug 3, 2011, 6:24 AM

Post #2 of 4 (2482 views)
Re: [rhqureshi] Realtime - Persistent - Event Based - Heartbeat Perl program [In reply to] Can't Post

I have not used it myself, but it sounds like POE would be what you're looking for.

http://search.cpan.org/search?query=POE&mode=all

http://poe.perl.org/


rhqureshi
New User

Aug 15, 2011, 2:34 AM

Post #3 of 4 (2414 views)
Re: [FishMonger] Realtime - Persistent - Event Based - Heartbeat Perl program [In reply to] Can't Post

Thanks a Lot FishMonger,
POE is a beautiful discovery. It solves 95% of my problems. Although there is one feature missing in POE (or may be i have not discovered it yet). I need to have prioritized execution of session in my program. For example, if i have lets say 10000 running sessions, each with a delay, or alarm set for every X second. If 5000 sessions are scheduled to execute on same time, then there will be delay in processing of all of those sessions. So i need to prioritize some sessions to execute first and the rest later.

Please help...


FishMonger
Veteran / Moderator

Aug 15, 2011, 7:12 AM

Post #4 of 4 (2407 views)
Re: [rhqureshi] Realtime - Persistent - Event Based - Heartbeat Perl program [In reply to] Can't Post

As I mentioned in my first post, I haven't use POE, so I don't know if it supports the type of prioritization that you want.

Have you tried posting your question on their mailing list?
http://poe.perl.org/?POE_Support_Resources/POE%27s_mailing_list

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives