cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Hoskens" ...@schaubroeck.be>
Subject Re: Send Page, continue processing
Date Tue, 02 Mar 2004 08:58:27 GMT
   I tried to call a pipeline after a sendPage():

<snip>
    cocoon.sendPage(page);
    cocoon.log.debug("page send?");
     // go ahead and do the expensive processing of generating a pdf
     var out = new java.io.ByteArrayOutputStream();
     cocoon.log.debug("outputstream ready");
     cocoon.processPipelineTo(userdir + "/" + usersubdir + "/test-pdf",
null, out);
     cocoon.log.debug("outputtin");
     cocoon.log.debug(out.toString());
     cocoon.log.debug("done");
     out.close();
</snip>

This doesn't crash, but the client browser is still loading until  pdf is
generated. But I'm testing on one PC so maybe fop generation stalls
everything? Is that possible?
This isn't a thread of course, but if the sendPage() does indeed finish
before the debugging logs "page send?", the page should be on its way to the
client.while the function continues. (well, that's what I would expect)
Can I ( as a second tryout) create a thread in flowscript that calls the
same pipe?

Kind Regards,

Jan


----- Original Message ----- 
From: "Bruno Dumon" <bruno@outerthought.org>
To: <users@cocoon.apache.org>
Sent: Monday, March 01, 2004 7:40 PM
Subject: Re: Send Page, continue processing


> On Mon, 2004-03-01 at 19:14, Ugo Cei wrote:
> > Jan Hoskens wrote:
> > > If I use sendPage() instead of sendPageAndWait() the
pipelineprocessing is
> > > given back to cocoon (in the docs), so if I place some code after
that, will
> > > cocoon first end that function (and thus giving a response) and goes
on with
> > > the remaining code? I know that this isn't the idea behind that
function, I
> > > do use it for its normal behaviour, but it's just a thought!
> >
> > If I understand your question correctly, yes, code following
> > cocoon.sendPage will be execute immediately, _while_ the response in
> > being sent to the client.
>
> hmm, with "while" you imply that both are executed on separate threads?
> This would suprise me.
>
> >
> > You can check it out yourself by putting a "print" statement right after
> > sendPage.
>
>
> -- 
> Bruno Dumon                             http://outerthought.org/
> Outerthought - Open Source, Java & XML Competence Support Center
> bruno@outerthought.org                          bruno@apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message