On Sun, 13 Mar 2005 06:28:24 -0500 Ciro The Spider-Man <[EMAIL PROTECTED]> wrote:
> The project at hand is an IRC bot with web connectivity. The desired > end at this point is to visit http://hostname:port/whois/username, and > have the web browser output the data from the irc_whois event. I tried [...] > is always 1 query behind. Is there any way I can make > POE::Component::Server::HTTP branch immediately and wait for the > result? [...] > So of course, when the next query comes around, the first query is > still sitting on the heap, so it gets used, then overwritten, etc... > > What fundamental fact am I overlooking? > > Thanks for any tips. > -C Greetings, Be advised, my first post to the list, I'm new to POE. But it's been a few hours without a reply, and this list doesn't see much traffic, therefore .. I'll take a swing: First, have you looked at this? http://poe.perl.org/?POE_Cookbook/Web_Server_With_Forking Next, although it's a client, not server, Randal's article entitled "Doing many things at once" seems relevant: http://www.stonehenge.com/merlyn/LinuxMag/col41.html It sounds like you want to be using 'call' instead of 'yield'. (see POE::Kernel) This of course, will block _everything_ until that whois finishes. I'd worry about forking first, then your choice of call or yield seems moot, I believe. But now let me ask you this: Are you sure you want POE for the HTTP server? (ayee! 1st post heresy?!) I understand this lets the IRC part stay connected, as well as serving the HTTP requests. But have you considered having a standard CGI talk to your stay-connected-POE IRC bot (behind the scenes)? Just a thought .. That, or even .. *must* it be real-time? Otherwise, you could just periodically write out the whois for all users, to a place the server can get to it. No offense intended to the respective POE/HTTP authors, just trying to provide alternatives, and I'm always very hesitant to reinvent Apache for public use. -Jay