simpleHTTP flushing problem

vidals <[email protected]>
Newsgroups gmane.comp.lang.perl.poe
Organization http://groups.google.com
Message-ID <fa06a5d0-e22d-49cc-8815-39ec71f43e7f@u10g2000prn.googlegroups.com>
Does anyone have experience with  POE::Component::Server::SimpleHTTP?

I need help in understanding how to flush my response immediately upon
calling $_[KERNEL]->call( 'HTTPD', 'DONE', $response );

Here are the two lines in question taken from my "sub GOT_REQ":

                $_[KERNEL]->call( 'HTTPD', 'DONE',
$response );
                $_[KERNEL]->post( 'PROCESS_XML',
'create_xml_response', $nf, $xml_request );

I need the "call" to occur immediately and send a 0 (ok) or 1 (error)
to the client. AND THEN AFTER continue to process the xml request in
another session called PROCESS_XML. However, the 0 or 1 is *not* being
sent out to the client until after the PROCESS_XML session finishes,
which can take more than a minute. Why doesn't call('HTTPD'...) output
right away?

Any help would be greatly appreciated.

sub GOT_REQ {
                # ARG0 = HTTP::Request object, ARG1 = HTTP::Response
object, ARG2 = the DIR that matched
                my( $request, $response, $dirmatch ) = @_[ ARG0 ..
ARG2 ];

                $response->code( 200 );

                my $xml_request =
&retrieve_multipart_content($request, $response);
                my $nf  = &parse_content( $xml_request );

                $response->content( $nf->{ReturnCode} );

                # We are done! For speed, you could use $_[KERNEL]-
>call( ... )
                $_[KERNEL]->call( 'HTTPD', 'DONE',
$response );
                $_[KERNEL]->post( 'PROCESS_XML',
'create_xml_response', $nf, $xml_request );
        }

Gil Vidals
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.