you have to call your code in a separate Thread
...
it can be inline as well..
private int progress;
public void getAll(){
final Sth myVar
new Thread(new Runnable(){
public void run(){
do long running code here, and set progress variable if possible
}
}).start();
}
aft
Hi Davor,
getAll is not async, it will not return immediately, how to make a service
async? thanks.
Davor Hrg wrote:
>
> are you sure
> fileService.getAll();
> is async and returns immediately ?
>
> Davor Hrg
>
>
>
> On Jan 25, 2008 4:36 PM, Angelo Chen <[EMAIL PROTECTED]> wrote:
>>
>> Hi
are you sure
fileService.getAll();
is async and returns immediately ?
Davor Hrg
On Jan 25, 2008 4:36 PM, Angelo Chen <[EMAIL PROTECTED]> wrote:
>
> Hi Davor,
>
> the service downloads files from remote server which takes quite long time,
> the code is:
>
> @Inject private FileService fileServic
Hi Davor,
the service downloads files from remote server which takes quite long time,
the code is:
@Inject private FileService fileService;
Class onActionFromTest() throws Exception {
try {
fileService.getAll();
}
} catch (CodeExi
hm.. I'm not following you ...
you say you download sth ...
does your service download sth from some server to yourown
or is browser downloading from your server ...
could you say more about your case ... some ceode mybe ...
Davor Hrg
On Jan 25, 2008 11:08 AM, Angelo Chen <[EMAIL PROTECTED]> wr
Hi Davor, Andy,
Thanks for the reply, what I do now is, just start the service, and i can
go to other pages as well, but if I stay in the same page where i start the
service, the cursor will be in the 'wait' state, i have to leave the page
first, any idea?
A.C.
Davor Hrg wrote:
>
> Tapestry-
Angelo,
Additionally, if you have a job that you want to schedule to do this
download, you could use a scheduler such as Quartz to kick off the job
without any intervention.
Andy
On Thu, 2008-01-24 at 01:45 -0800, Angelo Chen wrote:
> Hi,
>
> I have a service which does some file download that
Tapestry-ioc will not generate threads for you,
taopestry-ioc makes sure that some resources are unique per thread,
and threads can be generated where ever. They mostly come from underlaying
server for each request.
If you spawn your own thread, you can freely use any threaded resource,
just make