HTTP server in POE with a twist

2005-12-06 Thread Pedro Melo Cunha

Hi,

I need to write a HTTP server that interacts with XMPP, using POE.

The problem is that after a HTTP request, I have to do some XMPP  
transactions and only after that I can generate the response.


From the PoCo::Server::HTTP docs, I don't seem to be able to put a  
request on hold, do some other stuff, and then generate the response,  
correct?


Anybody done something like this before?

Thanks,


Re: HTTP server in POE with a twist

2005-12-06 Thread Mathieu Longtin
In the content handler, return RC_WAIT instead of RC_OK,
this will delay the sending of the response.

When the $response object is filled and ready, call:
  $response-continue();

This will tell the server to send the response.

-Mathieu

--- Pedro Melo Cunha [EMAIL PROTECTED] wrote:

 Hi,
 
 I need to write a HTTP server that interacts with XMPP,
 using POE.
 
 The problem is that after a HTTP request, I have to do
 some XMPP  
 transactions and only after that I can generate the
 response.
 
  From the PoCo::Server::HTTP docs, I don't seem to be
 able to put a  
 request on hold, do some other stuff, and then generate
 the response,  
 correct?
 
 Anybody done something like this before?
 
 Thanks,
 




__ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 



Re: HTTP server in POE with a twist

2005-12-06 Thread Pedro Melo Cunha

Many thanks,

I missed that from the docs, I'm must be blind or something. :(

Sorry bout that.

On Dec 6, 2005, at 1:10 PM, Mathieu Longtin wrote:


In the content handler, return RC_WAIT instead of RC_OK,
this will delay the sending of the response.

When the $response object is filled and ready, call:
  $response-continue();

This will tell the server to send the response.

-Mathieu

--- Pedro Melo Cunha [EMAIL PROTECTED] wrote:


Hi,

I need to write a HTTP server that interacts with XMPP,
using POE.

The problem is that after a HTTP request, I have to do
some XMPP
transactions and only after that I can generate the
response.

 From the PoCo::Server::HTTP docs, I don't seem to be
able to put a
request on hold, do some other stuff, and then generate
the response,
correct?

Anybody done something like this before?

Thanks,






__
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com






poe::stage usage

2005-12-06 Thread Mathieu Longtin
Hi,

I know Rocco has been pestering us to look at POE::Stage
for a while, so I finally did that. I am a bit confused, so
I'm going to explain how I understand it works, and you
tell me if I got it right.

$self-{req} is the request currently being handled. You
store all the intervening stages so that they dissappear if
you cancel the request mid-way. Is that right?

Is $self-{rsp} strictly there for the recall method?

Is this more or less like $kernel-call(stage1,
hello_world):

   $stage1-hello_world();

And lastly, if I do this:

   $stage1 = undef;

To which extent are all the pending requests of $stage1
cancelled? Is everything immediate? Will it close any
associate sockets right away? What happens if I still have
request object that involves $stage1? Do I need to define
DESTROY in my stages to clean up after them?

Thanks

-Mathieu



__ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 



poe::stage and die

2005-12-06 Thread Mathieu Longtin
What does POE::Stage do when a method dies?



__ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com