You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chung Khanh Duy <ch...@gmail.com> on 2014/09/03 13:51:29 UTC

Update zone out side main thread

Hi experts,

I am facing the problem :

- I have one action link in tml with its name is alink binding with zone

<t:actionlink id="alink"  t:zone = "resultZone" />

- in Java code I have:

onActionFromALink() {

// do something
if (request.isXHR()) {
   return resultZone;
}

}

So now I would like to do something in another thread and after this thread
completed, I will render resultZone. Is that possible ? Because I would
like to increase performance in case "do something" consume a lot of time.

Thanks,
Duy.



--

Re: Update zone out side main thread

Posted by Chris Poulsen <ma...@nesluop.dk>.
Could this be a case for ProgressiveDisplay?

-- 
Chris


On Wed, Sep 3, 2014 at 5:09 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy <
> chungkhanhduy1985@gmail.com> wrote:
>
>  Hi experts,
>>
>
> Hi!
>
>
>  So now I would like to do something in another thread and after this
>> thread completed, I will render resultZone. Is that possible ?
>>
>
> Yes and no. Yes if you don't mind the AJAX request being blocked until the
> other thread finishes, no otherwise. That would need async support,
> something Tapestry doesn't have yet and only the latest servlet containers
> support.
>
>
>  Because I would
>> like to increase performance in case "do something" consume a lot of time.
>>
>
> The general rule for performance in any kind of program is to not optimize
> something anything unless you're already sure this something is actually a
> bottleneck. Otherwise, you risk complicating and breaking a piece of code
> for no gain.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Update zone out side main thread

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 03 Sep 2014 21:56:28 -0300, Chung Khanh Duy  
<ch...@gmail.com> wrote:

> Thanks for your answers. Does any one have example for that ? I went
> through all samples in jumpstart site but it looks like does not have any
> sample that I am looking for.

For the non-async-request option, any Java solution will do.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: Update zone out side main thread

Posted by Chung Khanh Duy <ch...@gmail.com>.
Thanks everyone. I will try.

Duy.
On Sep 4, 2014 8:21 AM, "Geoff Callender" <
geoff.callender.jumpstart@gmail.com> wrote:

> How about making onActionFromALink() return a zone that contains a
> ProgressiveDisplay, and have the ProgressiveDisplay do "do something"?
>
>
> http://jumpstart.doublenegative.com.au/jumpstart7/examples/ajax/progressivedisplay
>
> Cheers,
>
> Geoff
>
> On 4 Sep 2014, at 10:56 am, Chung Khanh Duy <ch...@gmail.com>
> wrote:
>
> > Thanks for your answers. Does any one have example for that ? I went
> > through all samples in jumpstart site but it looks like does not have any
> > sample that I am looking for.
> >
> > Thanks.
> > Duy
> >
> >
> > On Wed, Sep 3, 2014 at 10:09 PM, Thiago H de Paula Figueiredo <
> > thiagohp@gmail.com> wrote:
> >
> >> On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy <
> >> chungkhanhduy1985@gmail.com> wrote:
> >>
> >> Hi experts,
> >>>
> >>
> >> Hi!
> >>
> >>
> >> So now I would like to do something in another thread and after this
> >>> thread completed, I will render resultZone. Is that possible ?
> >>>
> >>
> >> Yes and no. Yes if you don't mind the AJAX request being blocked until
> the
> >> other thread finishes, no otherwise. That would need async support,
> >> something Tapestry doesn't have yet and only the latest servlet
> containers
> >> support.
> >>
> >>
> >> Because I would
> >>> like to increase performance in case "do something" consume a lot of
> time.
> >>>
> >>
> >> The general rule for performance in any kind of program is to not
> optimize
> >> something anything unless you're already sure this something is
> actually a
> >> bottleneck. Otherwise, you risk complicating and breaking a piece of
> code
> >> for no gain.
> >>
> >> --
> >> Thiago H. de Paula Figueiredo
> >> Tapestry, Java and Hibernate consultant and developer
> >> http://machina.com.br
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >
> >
> > --
> > Chung Khánh Duy
> > Project Support Manager
> > Formos
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Update zone out side main thread

Posted by Geoff Callender <ge...@gmail.com>.
How about making onActionFromALink() return a zone that contains a ProgressiveDisplay, and have the ProgressiveDisplay do "do something"?

	http://jumpstart.doublenegative.com.au/jumpstart7/examples/ajax/progressivedisplay

Cheers,

Geoff

On 4 Sep 2014, at 10:56 am, Chung Khanh Duy <ch...@gmail.com> wrote:

> Thanks for your answers. Does any one have example for that ? I went
> through all samples in jumpstart site but it looks like does not have any
> sample that I am looking for.
> 
> Thanks.
> Duy
> 
> 
> On Wed, Sep 3, 2014 at 10:09 PM, Thiago H de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
> 
>> On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy <
>> chungkhanhduy1985@gmail.com> wrote:
>> 
>> Hi experts,
>>> 
>> 
>> Hi!
>> 
>> 
>> So now I would like to do something in another thread and after this
>>> thread completed, I will render resultZone. Is that possible ?
>>> 
>> 
>> Yes and no. Yes if you don't mind the AJAX request being blocked until the
>> other thread finishes, no otherwise. That would need async support,
>> something Tapestry doesn't have yet and only the latest servlet containers
>> support.
>> 
>> 
>> Because I would
>>> like to increase performance in case "do something" consume a lot of time.
>>> 
>> 
>> The general rule for performance in any kind of program is to not optimize
>> something anything unless you're already sure this something is actually a
>> bottleneck. Otherwise, you risk complicating and breaking a piece of code
>> for no gain.
>> 
>> --
>> Thiago H. de Paula Figueiredo
>> Tapestry, Java and Hibernate consultant and developer
>> http://machina.com.br
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 
> 
> 
> -- 
> Chung Khánh Duy
> Project Support Manager
> Formos


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


Re: Update zone out side main thread

Posted by Chung Khanh Duy <ch...@gmail.com>.
Thanks for your answers. Does any one have example for that ? I went
through all samples in jumpstart site but it looks like does not have any
sample that I am looking for.

Thanks.
Duy


On Wed, Sep 3, 2014 at 10:09 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy <
> chungkhanhduy1985@gmail.com> wrote:
>
>  Hi experts,
>>
>
> Hi!
>
>
>  So now I would like to do something in another thread and after this
>> thread completed, I will render resultZone. Is that possible ?
>>
>
> Yes and no. Yes if you don't mind the AJAX request being blocked until the
> other thread finishes, no otherwise. That would need async support,
> something Tapestry doesn't have yet and only the latest servlet containers
> support.
>
>
>  Because I would
>> like to increase performance in case "do something" consume a lot of time.
>>
>
> The general rule for performance in any kind of program is to not optimize
> something anything unless you're already sure this something is actually a
> bottleneck. Otherwise, you risk complicating and breaking a piece of code
> for no gain.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Chung Khánh Duy
Project Support Manager
Formos

Re: Update zone out side main thread

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy  
<ch...@gmail.com> wrote:

> Hi experts,

Hi!

> So now I would like to do something in another thread and after this  
> thread completed, I will render resultZone. Is that possible ?

Yes and no. Yes if you don't mind the AJAX request being blocked until the  
other thread finishes, no otherwise. That would need async support,  
something Tapestry doesn't have yet and only the latest servlet containers  
support.

> Because I would
> like to increase performance in case "do something" consume a lot of  
> time.

The general rule for performance in any kind of program is to not optimize  
something anything unless you're already sure this something is actually a  
bottleneck. Otherwise, you risk complicating and breaking a piece of code  
for no gain.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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