Update zone out side main thread

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Update zone out side main thread

duymap
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.



--
Reply | Threaded
Open this post in threaded view
|

Re: Update zone out side main thread

Thiago H de Paula Figueiredo
On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy  
<[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Update zone out side main thread

Chris Poulsen
Could this be a case for ProgressiveDisplay?

--
Chris


On Wed, Sep 3, 2014 at 5:09 PM, Thiago H de Paula Figueiredo <
[hidden email]> wrote:

> On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy <
> [hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Update zone out side main thread

duymap
In reply to this post by Thiago H de Paula Figueiredo
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 <
[hidden email]> wrote:

> On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy <
> [hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Chung Khánh Duy
Project Support Manager
Formos
Reply | Threaded
Open this post in threaded view
|

Re: Update zone out side main thread

Thiago H de Paula Figueiredo
On Wed, 03 Sep 2014 21:56:28 -0300, Chung Khanh Duy  
<[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Update zone out side main thread

JumpStart
In reply to this post by duymap
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 <[hidden email]> 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 <
> [hidden email]> wrote:
>
>> On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy <
>> [hidden email]> 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> --
> Chung Khánh Duy
> Project Support Manager
> Formos


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Update zone out side main thread

duymap
Thanks everyone. I will try.

Duy.
On Sep 4, 2014 8:21 AM, "Geoff Callender" <
[hidden email]> 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 <[hidden email]>
> 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 <
> > [hidden email]> wrote:
> >
> >> On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy <
> >> [hidden email]> 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: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
> >
> > --
> > Chung Khánh Duy
> > Project Support Manager
> > Formos
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>