You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Omar Adobati <om...@gmail.com> on 2006/08/28 09:33:32 UTC
Parallell sitemap tasks
Good Morning,
It's possible to have a pipeline working in parallel instead of in serial way?
What I means is: If I need to execute more than one task at the same
time, suppose to generate a html file to display to the screen and an
e-mail to send to someone... could I do this in the "same" time? Or I
have to execute them in a serial way?
--
Omar Adobati
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Re: Parallell sitemap tasks
Posted by Bertrand Delacretaz <bd...@apache.org>.
On 8/28/06, Omar Adobati <om...@gmail.com> wrote:
> ...suppose I
> want to aggregate more than one action or more then one transformer.
> I could have back more than one "response" (success or error) form
> each one. Could I aggregate them in one "result page" using aggregate
> (maybe in collaboration with cocoon protocol)?..
sure, that's how you'd do it: use the cocoon protocol and transform
the results to status information on your HTML page.
> ...If each "job" take
> different time to be executed will I have the "result page" at the end
> of the last (longer??) job?..
Using aggregates, yes, in principle. It depends on how "streamable"
the rest of your pipeline is, and getting the full response will wait
on all aggregates.
> ...(if yes, maybe with some ajax code will be
> possible to have my "result page" dynamically build with results from
> each job)...
That's a way of doing it: have the pipelines start the "long" jobs,
and use ajax + other pipelines to get their status later, once the
page is loaded.
> ...Same questions for the flowscript too...
Flowscript will give you more flexibility w.r.t multi-threading and
precise control of what's happening.
If your problem is actually sending email, the best way by far is to
consider some queuing mechanism, as you have no way of knowing how
much time it will take to actually send an email.
IIRC, Daisy queues outgoing emails in its database (or using JMS?),
you might want to look at how they do it. But, depending on your peak
load, simpler options might be good enough.
-Bertrand
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Parallell sitemap tasks
Posted by Omar Adobati <om...@gmail.com>.
On 8/28/06, Bertrand Delacretaz <bd...@apache.org> wrote:
> On 8/28/06, Omar Adobati <om...@gmail.com> wrote:
>
> > ...If I need to execute more than one task at the same
> > time, suppose to generate a html file to display to the screen and an
> > e-mail to send to someone... could I do this in the "same" time?...
>
> You could either
>
> a) Aggregate the mail-generating pipeline with the ones that generate
> your html page, which would cause both to execute at the same time
> (conceptually at least,not sure about multi-threading in this case).
Using aggregates was my idea too. But I have some doubts: suppose I
want to aggregate more than one action or more then one transformer.
I could have back more than one "response" (success or error) form
each one. Could I aggregate them in one "result page" using aggregate
(maybe in collaboration with cocoon protocol)? If each "job" take
different time to be executed will I have the "result page" at the end
of the last (longer??) job? (if yes, maybe with some ajax code will be
possible to have my "result page" dynamically build with results from
each job).
> or
>
> b) Have a flowscript as part of your html page generation, and call
> java code there to send the email.
>
> -Bertrand
Same questions for the flowscript too...
Omar.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Parallell sitemap tasks
Posted by Bertrand Delacretaz <bd...@apache.org>.
On 8/28/06, Omar Adobati <om...@gmail.com> wrote:
> ...If I need to execute more than one task at the same
> time, suppose to generate a html file to display to the screen and an
> e-mail to send to someone... could I do this in the "same" time?...
You could either
a) Aggregate the mail-generating pipeline with the ones that generate
your html page, which would cause both to execute at the same time
(conceptually at least,not sure about multi-threading in this case).
or
b) Have a flowscript as part of your html page generation, and call
java code there to send the email.
-Bertrand
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org