Don't ask to ask, just ask | |
PerlMonks |
Re: Design decision, call backs and network databy Fletch (Bishop) |
on Jul 25, 2004 at 12:10 UTC ( [id://377263]=note: print w/replies, xml ) | Need Help?? |
Use POE! It's meant for this kind of event driven programming. You fire off whatever request to get more info and note in your instance that you're waiting on requested information. Your got_traffic callback checks if you're expecting something or not when it receives a reply. You could even setup an alarm event that clears that state if you don't get a reply back after however long.
In Section
Seekers of Perl Wisdom
|
|