Matt S Trout said:
>Try storing the request and response
>objects in the heap along with the query, with a unique key to access them,
>then in the irc_whois sub pull the reponse object and populate it there.

Thought about that. I was afraid that was kludgy, so I figured I'd ask
here about a "right" way to do it. ;) I'm still learning POE, so the
input doesn't hurt. :)

Duane Beck said: 
>Have you tried using call instead of yield?  Yield just puts the
>specified event on the waiting queue to be handled after the current
>event returns.  Call will call the event handler immediately and wait
>for the result.

Yep, that was the first thing I tried. I actually completely rewrote
the IRC portion of the bot to use the 'new way.'

Jay Jarvinen said: 
> But now let me ask you this: Are you sure you want POE for the HTTP
> server?

Eh, whether I want to or not is moot. The bot is actually a buddy's
project, and he asked me for help because I'm the best perl programmer
in our little clique. Then I got obsessed and sort of took over. :) 
That said, for something as small as this, Apache is a bit of a
heavyweight.


Rocco said:
>You're always whois'ing "nick" (or is it the result of evaluating sub
> nick() ?)  Either way, it's probably not what you intended.

Yeah, that was a typo in entering the code into the mail (lack of
cut/paste). It's correct in the actual code.

>I think a better idea is to have whoisHandler return RC_WAIT (see
>perldoc POE::Component::Client::HTTP) and pass $nick and $response to
>the IRC part.

I thought of that, too, but the doc for PoCo::HTTPD seems to be a bit,
shall we say, "light" on the subject of how to actually USE it.
Whenever I tried, it failed (squid gave me an error about a "zero
length response"). I know I'm doing something wrong, but I can't
figure out exactly what.

Anyway, thanks for all the input, guys. I'll mess with it some more
and see if I can make returning RC_WAIT work.

Reply via email to