Re: How to get rid of the delay after the real work is done?
Rocco Caputo <[email protected]>
| Newsgroups | gmane.comp.lang.perl.poe |
|---|---|
| Message-ID | <[email protected]> |
You can shut down POE::Component::Client::HTTP by posting a "shutdown" event to it, generally by its alias. Interesting. It could be that the program is exiting before connections are released by POE::Component::Client::Keepalive (used by the HTTP client), and global destruction is causing things to be freed out of order. I wonder why I hadn't seen that when I wrote it... -- Rocco Caputo - [email protected] On Jun 19, 2009, at 16:08, Michael Lackhoff wrote: > On 19.06.2009 18:35 Rocco Caputo wrote: > >> That's probably the keep-alive timer in POE::Component::Client::HTTP. >> You can preemptively shutdown the client when you know you won't need >> it anymore. > > How would I do that? As I said I am totally new to POE and still have > some problems picking up the concepts involved. > >> Starting and stopping POE involves some setup & cleanup overhead. >> I'm >> not sure if the overhead will exceed your expectations. If it >> does, I >> have a POE::Component::Client::HTTP wrapper that avoids the stop/ >> restart and provides a different API. Experimental, unreleased code, >> no warranties, same-terms-as-perl, etc.: >> >> http://poe.dyndns.org/~troc/tmp/pua.pl >> http://poe.dyndns.org/~troc/tmp/pua-defer.pl > > Thanks, I will try them with my application (on Monday). Looks > promising, though in pua.pl I get this error message: > > (in cleanup) Can't call method "free" on an undefined value at > /usr/local/share/perl/5.8.8/POE/Component/Connection/Keepalive.pm line > 44 during global destruction. > > -Michael