I have the following situation.
I have my web site written in Tapestry. On one of the pages, I'm required to generate a fairly large Excel or PDF document (around 20 MB). Now, since the entire process takes time, I'm asking my user to wait a bit.
However, when I tried to test the upper limits, I noticed that my entire application (not just the web part) freezes, because the generation eats up all the resources and the rest of the website and application becomes unresponsive.
Here is the flow how I've been doing it so far.
InputStream
of the created file is passed all the way up to Tapestry which wraps it in StreamResponse
and offers the downloadWhat would be an appropriate way to handle this problem?
Could I perhaps use Tapestry's ParallelExecutor
from some Tapestry service of mine in a manner like this?
Future<InputStream> future = executor.invoke(new Invokable<InputStream>() { ... });
My main objective is that the application and website keep running, that they do not freeze.
Thank you in advance.
Take a look at the progresslink demo from tapestry stitch. It might give you some inspiration to poll for a long running / asynchronous task in tapestry.