You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by mark goldin <ma...@gmail.com> on 2015/06/25 15:52:52 UTC

A script has executed for longer than ....

I have a large xml data that UI needs to process. I am getting the above
message about timing out. Not sure I can break my function into smaller
pieces. Any other idea?

Thanks

RE: A script has executed for longer than ....

Posted by Frédéric THOMAS <we...@hotmail.com>.
> Cannot download EasyWorker. File not found.

Yes, they remove it after 1 month, if you want to use it, the best is you compile it from the sources.

Frédéric THOMAS


----------------------------------------
> From: markzolotoy@gmail.com
> Date: Fri, 26 Jun 2015 13:24:16 +0000
> Subject: Re: A script has executed for longer than ....
> To: users@flex.apache.org
>
> Cannot download EasyWorker. File not found.
>
> On Fri, Jun 26, 2015 at 4:04 AM mark goldin <ma...@gmail.com> wrote:
>
>> Ok, I got it running but it still timing out.
>> Here is some code:
>>
>> public function result(data:Object):void
>> {
>> var re:ResultEvent = ResultEvent(data);
>> thread = new
>> PseudoThread(UIComponent(Application.application).systemManager,
>> processXML, re.result.resultData);
>> }
>> private function processXML(resultData:XMLList):void
>>
>> Did not change anything in PseudoThread.
>>
>> On Thu, Jun 25, 2015 at 3:39 PM Alex Harui <ah...@adobe.com> wrote:
>>
>>> In Flex 3, mx.core.Application.application from anywhere should give you
>>> access to the Application and thus its stage.
>>>
>>> In Flex 4, use FlexGlobals.topLevelApplication.
>>>
>>> -Alex
>>>
>>> On 6/25/15, 10:59 AM, "mark goldin" <ma...@gmail.com> wrote:
>>>
>>>>Alex, I need to use it from a command class that does not have
>>>>systemManager or its stages. How do I go about it?
>>>>
>>>>On Thu, Jun 25, 2015 at 11:34 AM Javier Guerrero García
>>>><ja...@gmail.com>
>>>>wrote:
>>>>
>>>>> More on that:
>>>>>
>>>>>
>>>>>
>>> http://www.jamesward.com/2008/11/21/drunk-on-software-episode-3-performan
>>>>>ce-pitfalls-of-flexs-arraycollection/
>>>>>
>>>>> On Thu, Jun 25, 2015 at 6:29 PM, Javier Guerrero García
>>>>><javi.gg@gmail.com
>>>>>>
>>>>> wrote:
>>>>>
>>>>>> Hi Mark:
>>>>>>
>>>>>> A long shot here: are you sure that, while you are processing the
>>> XML,
>>>>>> you're NOT triggering constant UI updates on each operation? For
>>>>> instance:
>>>>>> if after processing each XML item, you are adding the final result to
>>>>>an
>>>>>> ArrayCollection, and you have some rendering component bound to that
>>>>>> ArrayCollection, that could cause a total repaint of the item
>>>>>renderers
>>>>> FOR
>>>>>> EACH XML ITEM processed, hence causing the timeout. Something similar
>>>>>> happened to me a while ago, and after noticing and solving it, I can
>>>>>say
>>>>>> that 60 seconds are more than enough to process a few hundreds of
>>>>> thousand
>>>>>> XML items, and unless your XML is REALLY huge that should be enough
>>> :)
>>>>>>
>>>>>> If that applies, the obvious workaround is:
>>>>>>
>>>>>> 1. Do all your updates and additions on a new ArrayCollection (not on
>>>>>the
>>>>>> one bound to the component's dataProvider), and then just swap the
>>>>>> dataProvider of the component to point to the newly populated
>>>>>> ArrayCollection instead
>>>>>> 2. Or call "thefunctionthatdisabledautoupdates" in advance (don't
>>>>> remember
>>>>>> the exact name right now) on the bound arraycollection before
>>> starting
>>>>>> processing your XML, modify/update your arraycollection items, and
>>>>>then
>>>>>> enabling it afterwards.
>>>>>>
>>>>>> P.S. "myCollection.disableAutoUpdate(); ", that was it :)
>>>>>>
>>>>>
>>>>>
>>> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668
>>>>>d2-7fe7.html
>>>>>>
>>>>>> P.P.S. If none of that applies.... would some kind of "pagination" on
>>>>>the
>>>>>> UI solve it?
>>>>>>
>>>>>> On Thu, Jun 25, 2015 at 3:52 PM, mark goldin <ma...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> I have a large xml data that UI needs to process. I am getting the
>>>>>above
>>>>>>> message about timing out. Not sure I can break my function into
>>>>>smaller
>>>>>>> pieces. Any other idea?
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>
>>>
 		 	   		  

Re: A script has executed for longer than ....

Posted by mark goldin <ma...@gmail.com>.
I am trying to implement workers. I am not sure how I tell a worker what to
do.

On Fri, Jun 26, 2015 at 8:24 AM mark goldin <ma...@gmail.com> wrote:

> Cannot download EasyWorker. File not found.
>
> On Fri, Jun 26, 2015 at 4:04 AM mark goldin <ma...@gmail.com> wrote:
>
>> Ok, I got it running but it still timing out.
>> Here is some code:
>>
>> public function result(data:Object):void
>> {
>>  var re:ResultEvent = ResultEvent(data);
>> thread = new
>> PseudoThread(UIComponent(Application.application).systemManager,
>> processXML, re.result.resultData);
>> }
>> private function processXML(resultData:XMLList):void
>>
>> Did not change anything in PseudoThread.
>>
>> On Thu, Jun 25, 2015 at 3:39 PM Alex Harui <ah...@adobe.com> wrote:
>>
>>> In Flex 3, mx.core.Application.application from anywhere should give you
>>> access to the Application and thus its stage.
>>>
>>> In Flex 4, use FlexGlobals.topLevelApplication.
>>>
>>> -Alex
>>>
>>> On 6/25/15, 10:59 AM, "mark goldin" <ma...@gmail.com> wrote:
>>>
>>> >Alex, I need to use it from a command class that does not have
>>> >systemManager or its stages. How do I go about it?
>>> >
>>> >On Thu, Jun 25, 2015 at 11:34 AM Javier Guerrero García
>>> ><ja...@gmail.com>
>>> >wrote:
>>> >
>>> >> More on that:
>>> >>
>>> >>
>>> >>
>>> http://www.jamesward.com/2008/11/21/drunk-on-software-episode-3-performan
>>> >>ce-pitfalls-of-flexs-arraycollection/
>>> >>
>>> >> On Thu, Jun 25, 2015 at 6:29 PM, Javier Guerrero García
>>> >><javi.gg@gmail.com
>>> >> >
>>> >> wrote:
>>> >>
>>> >> > Hi Mark:
>>> >> >
>>> >> > A long shot here: are you sure that, while you are processing the
>>> XML,
>>> >> > you're NOT triggering constant UI updates on each operation? For
>>> >> instance:
>>> >> > if after processing each XML item, you are adding the final result
>>> to
>>> >>an
>>> >> > ArrayCollection, and you have some rendering component bound to that
>>> >> > ArrayCollection, that could cause a total repaint of the item
>>> >>renderers
>>> >> FOR
>>> >> > EACH XML ITEM processed, hence causing the timeout. Something
>>> similar
>>> >> > happened to me a while ago, and after noticing and solving it, I can
>>> >>say
>>> >> > that 60 seconds are more than enough to process a few hundreds of
>>> >> thousand
>>> >> > XML items, and unless your XML is REALLY huge that should be enough
>>> :)
>>> >> >
>>> >> > If that applies, the obvious workaround is:
>>> >> >
>>> >> > 1. Do all your updates and additions on a new ArrayCollection (not
>>> on
>>> >>the
>>> >> > one bound to the component's dataProvider), and then just swap the
>>> >> > dataProvider of the component to point to the newly populated
>>> >> > ArrayCollection instead
>>> >> > 2. Or call "thefunctionthatdisabledautoupdates" in advance (don't
>>> >> remember
>>> >> > the exact name right now) on the bound arraycollection before
>>> starting
>>> >> > processing your XML, modify/update your arraycollection items, and
>>> >>then
>>> >> > enabling it afterwards.
>>> >> >
>>> >> > P.S. "myCollection.disableAutoUpdate(); ", that was it :)
>>> >> >
>>> >>
>>> >>
>>> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668
>>> >>d2-7fe7.html
>>> >> >
>>> >> > P.P.S. If none of that applies.... would some kind of "pagination"
>>> on
>>> >>the
>>> >> > UI solve it?
>>> >> >
>>> >> > On Thu, Jun 25, 2015 at 3:52 PM, mark goldin <markzolotoy@gmail.com
>>> >
>>> >> > wrote:
>>> >> >
>>> >> >> I have a large xml data that UI needs to process. I am getting the
>>> >>above
>>> >> >> message about timing out. Not sure I can break my function into
>>> >>smaller
>>> >> >> pieces. Any other idea?
>>> >> >>
>>> >> >> Thanks
>>> >> >>
>>> >> >
>>> >> >
>>> >>
>>>
>>>

Re: A script has executed for longer than ....

Posted by mark goldin <ma...@gmail.com>.
Cannot download EasyWorker. File not found.

On Fri, Jun 26, 2015 at 4:04 AM mark goldin <ma...@gmail.com> wrote:

> Ok, I got it running but it still timing out.
> Here is some code:
>
> public function result(data:Object):void
> {
>  var re:ResultEvent = ResultEvent(data);
> thread = new
> PseudoThread(UIComponent(Application.application).systemManager,
> processXML, re.result.resultData);
> }
> private function processXML(resultData:XMLList):void
>
> Did not change anything in PseudoThread.
>
> On Thu, Jun 25, 2015 at 3:39 PM Alex Harui <ah...@adobe.com> wrote:
>
>> In Flex 3, mx.core.Application.application from anywhere should give you
>> access to the Application and thus its stage.
>>
>> In Flex 4, use FlexGlobals.topLevelApplication.
>>
>> -Alex
>>
>> On 6/25/15, 10:59 AM, "mark goldin" <ma...@gmail.com> wrote:
>>
>> >Alex, I need to use it from a command class that does not have
>> >systemManager or its stages. How do I go about it?
>> >
>> >On Thu, Jun 25, 2015 at 11:34 AM Javier Guerrero García
>> ><ja...@gmail.com>
>> >wrote:
>> >
>> >> More on that:
>> >>
>> >>
>> >>
>> http://www.jamesward.com/2008/11/21/drunk-on-software-episode-3-performan
>> >>ce-pitfalls-of-flexs-arraycollection/
>> >>
>> >> On Thu, Jun 25, 2015 at 6:29 PM, Javier Guerrero García
>> >><javi.gg@gmail.com
>> >> >
>> >> wrote:
>> >>
>> >> > Hi Mark:
>> >> >
>> >> > A long shot here: are you sure that, while you are processing the
>> XML,
>> >> > you're NOT triggering constant UI updates on each operation? For
>> >> instance:
>> >> > if after processing each XML item, you are adding the final result to
>> >>an
>> >> > ArrayCollection, and you have some rendering component bound to that
>> >> > ArrayCollection, that could cause a total repaint of the item
>> >>renderers
>> >> FOR
>> >> > EACH XML ITEM processed, hence causing the timeout. Something similar
>> >> > happened to me a while ago, and after noticing and solving it, I can
>> >>say
>> >> > that 60 seconds are more than enough to process a few hundreds of
>> >> thousand
>> >> > XML items, and unless your XML is REALLY huge that should be enough
>> :)
>> >> >
>> >> > If that applies, the obvious workaround is:
>> >> >
>> >> > 1. Do all your updates and additions on a new ArrayCollection (not on
>> >>the
>> >> > one bound to the component's dataProvider), and then just swap the
>> >> > dataProvider of the component to point to the newly populated
>> >> > ArrayCollection instead
>> >> > 2. Or call "thefunctionthatdisabledautoupdates" in advance (don't
>> >> remember
>> >> > the exact name right now) on the bound arraycollection before
>> starting
>> >> > processing your XML, modify/update your arraycollection items, and
>> >>then
>> >> > enabling it afterwards.
>> >> >
>> >> > P.S. "myCollection.disableAutoUpdate(); ", that was it :)
>> >> >
>> >>
>> >>
>> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668
>> >>d2-7fe7.html
>> >> >
>> >> > P.P.S. If none of that applies.... would some kind of "pagination" on
>> >>the
>> >> > UI solve it?
>> >> >
>> >> > On Thu, Jun 25, 2015 at 3:52 PM, mark goldin <ma...@gmail.com>
>> >> > wrote:
>> >> >
>> >> >> I have a large xml data that UI needs to process. I am getting the
>> >>above
>> >> >> message about timing out. Not sure I can break my function into
>> >>smaller
>> >> >> pieces. Any other idea?
>> >> >>
>> >> >> Thanks
>> >> >>
>> >> >
>> >> >
>> >>
>>
>>

Re: A script has executed for longer than ....

Posted by Alex Harui <ah...@adobe.com>.

On 6/26/15, 8:39 AM, "mark goldin" <ma...@gmail.com> wrote:

>It's getting called just once.

Well, then that would be the problem.  PseudoThread can’t magically get
the player to spin threads.  It just automates calling a callback function
over and over again to do the total work in increments.

So, for some XML like
<xml>
  <node value=“1">
  <node value=“20">
  <node value=“55">
</xml>

You might set up an object like this:
  var state:Object = { currentIndex: 0, maxIndex: 3, total: 0, nodeList:
xml.node };

And a callback:

  function addNodes(obj:Object)
  {
     if (obj.currentIndex == obj.maxIndex) return false;

     var node:XML = obj.nodeList[obj.currentIndex];
     obj.total += int(node.@value);
     obj.currentIndex++;
     return true;
  }
  

Then you should see addNodes get called 4 times and dispatch the
threadComplete at which point state will have the right total.

-Alex

>
>On Fri, Jun 26, 2015 at 10:33 AM Alex Harui <ah...@adobe.com> wrote:
>
>> What work is done in processXML?  Step through it and make sure you are
>> done quickly and it gets called many times.
>>
>> On 6/26/15, 2:04 AM, "mark goldin" <ma...@gmail.com> wrote:
>>
>> >Ok, I got it running but it still timing out.
>> >Here is some code:
>> >
>> >public function result(data:Object):void
>> >{
>> > var re:ResultEvent = ResultEvent(data);
>> >thread = new
>> >PseudoThread(UIComponent(Application.application).systemManager,
>> >processXML, re.result.resultData);
>> >}
>> >private function processXML(resultData:XMLList):void
>> >
>> >Did not change anything in PseudoThread.
>> >
>> >On Thu, Jun 25, 2015 at 3:39 PM Alex Harui <ah...@adobe.com> wrote:
>> >
>> >> In Flex 3, mx.core.Application.application from anywhere should give
>>you
>> >> access to the Application and thus its stage.
>> >>
>> >> In Flex 4, use FlexGlobals.topLevelApplication.
>> >>
>> >> -Alex
>> >>
>> >> On 6/25/15, 10:59 AM, "mark goldin" <ma...@gmail.com> wrote:
>> >>
>> >> >Alex, I need to use it from a command class that does not have
>> >> >systemManager or its stages. How do I go about it?
>> >> >
>> >> >On Thu, Jun 25, 2015 at 11:34 AM Javier Guerrero García
>> >> ><ja...@gmail.com>
>> >> >wrote:
>> >> >
>> >> >> More on that:
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> 
>>http://www.jamesward.com/2008/11/21/drunk-on-software-episode-3-performan
>> >> >>ce-pitfalls-of-flexs-arraycollection/
>> >> >>
>> >> >> On Thu, Jun 25, 2015 at 6:29 PM, Javier Guerrero García
>> >> >><javi.gg@gmail.com
>> >> >> >
>> >> >> wrote:
>> >> >>
>> >> >> > Hi Mark:
>> >> >> >
>> >> >> > A long shot here: are you sure that, while you are processing
>>the
>> >>XML,
>> >> >> > you're NOT triggering constant UI updates on each operation? For
>> >> >> instance:
>> >> >> > if after processing each XML item, you are adding the final
>>result
>> >>to
>> >> >>an
>> >> >> > ArrayCollection, and you have some rendering component bound to
>> >>that
>> >> >> > ArrayCollection, that could cause a total repaint of the item
>> >> >>renderers
>> >> >> FOR
>> >> >> > EACH XML ITEM processed, hence causing the timeout. Something
>> >>similar
>> >> >> > happened to me a while ago, and after noticing and solving it, I
>> >>can
>> >> >>say
>> >> >> > that 60 seconds are more than enough to process a few hundreds
>>of
>> >> >> thousand
>> >> >> > XML items, and unless your XML is REALLY huge that should be
>> >>enough :)
>> >> >> >
>> >> >> > If that applies, the obvious workaround is:
>> >> >> >
>> >> >> > 1. Do all your updates and additions on a new ArrayCollection
>>(not
>> >>on
>> >> >>the
>> >> >> > one bound to the component's dataProvider), and then just swap
>>the
>> >> >> > dataProvider of the component to point to the newly populated
>> >> >> > ArrayCollection instead
>> >> >> > 2. Or call "thefunctionthatdisabledautoupdates" in advance
>>(don't
>> >> >> remember
>> >> >> > the exact name right now) on the bound arraycollection before
>> >>starting
>> >> >> > processing your XML, modify/update your arraycollection items,
>>and
>> >> >>then
>> >> >> > enabling it afterwards.
>> >> >> >
>> >> >> > P.S. "myCollection.disableAutoUpdate(); ", that was it :)
>> >> >> >
>> >> >>
>> >> >>
>> >>
>> >>
>> 
>>http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668
>> >> >>d2-7fe7.html
>> >> >> >
>> >> >> > P.P.S. If none of that applies.... would some kind of
>>"pagination"
>> >>on
>> >> >>the
>> >> >> > UI solve it?
>> >> >> >
>> >> >> > On Thu, Jun 25, 2015 at 3:52 PM, mark goldin
>> >><ma...@gmail.com>
>> >> >> > wrote:
>> >> >> >
>> >> >> >> I have a large xml data that UI needs to process. I am getting
>>the
>> >> >>above
>> >> >> >> message about timing out. Not sure I can break my function into
>> >> >>smaller
>> >> >> >> pieces. Any other idea?
>> >> >> >>
>> >> >> >> Thanks
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >>
>> >>
>> >>
>>
>>


Re: A script has executed for longer than ....

Posted by mark goldin <ma...@gmail.com>.
It's getting called just once.

On Fri, Jun 26, 2015 at 10:33 AM Alex Harui <ah...@adobe.com> wrote:

> What work is done in processXML?  Step through it and make sure you are
> done quickly and it gets called many times.
>
> On 6/26/15, 2:04 AM, "mark goldin" <ma...@gmail.com> wrote:
>
> >Ok, I got it running but it still timing out.
> >Here is some code:
> >
> >public function result(data:Object):void
> >{
> > var re:ResultEvent = ResultEvent(data);
> >thread = new
> >PseudoThread(UIComponent(Application.application).systemManager,
> >processXML, re.result.resultData);
> >}
> >private function processXML(resultData:XMLList):void
> >
> >Did not change anything in PseudoThread.
> >
> >On Thu, Jun 25, 2015 at 3:39 PM Alex Harui <ah...@adobe.com> wrote:
> >
> >> In Flex 3, mx.core.Application.application from anywhere should give you
> >> access to the Application and thus its stage.
> >>
> >> In Flex 4, use FlexGlobals.topLevelApplication.
> >>
> >> -Alex
> >>
> >> On 6/25/15, 10:59 AM, "mark goldin" <ma...@gmail.com> wrote:
> >>
> >> >Alex, I need to use it from a command class that does not have
> >> >systemManager or its stages. How do I go about it?
> >> >
> >> >On Thu, Jun 25, 2015 at 11:34 AM Javier Guerrero García
> >> ><ja...@gmail.com>
> >> >wrote:
> >> >
> >> >> More on that:
> >> >>
> >> >>
> >> >>
> >>
> >>
> http://www.jamesward.com/2008/11/21/drunk-on-software-episode-3-performan
> >> >>ce-pitfalls-of-flexs-arraycollection/
> >> >>
> >> >> On Thu, Jun 25, 2015 at 6:29 PM, Javier Guerrero García
> >> >><javi.gg@gmail.com
> >> >> >
> >> >> wrote:
> >> >>
> >> >> > Hi Mark:
> >> >> >
> >> >> > A long shot here: are you sure that, while you are processing the
> >>XML,
> >> >> > you're NOT triggering constant UI updates on each operation? For
> >> >> instance:
> >> >> > if after processing each XML item, you are adding the final result
> >>to
> >> >>an
> >> >> > ArrayCollection, and you have some rendering component bound to
> >>that
> >> >> > ArrayCollection, that could cause a total repaint of the item
> >> >>renderers
> >> >> FOR
> >> >> > EACH XML ITEM processed, hence causing the timeout. Something
> >>similar
> >> >> > happened to me a while ago, and after noticing and solving it, I
> >>can
> >> >>say
> >> >> > that 60 seconds are more than enough to process a few hundreds of
> >> >> thousand
> >> >> > XML items, and unless your XML is REALLY huge that should be
> >>enough :)
> >> >> >
> >> >> > If that applies, the obvious workaround is:
> >> >> >
> >> >> > 1. Do all your updates and additions on a new ArrayCollection (not
> >>on
> >> >>the
> >> >> > one bound to the component's dataProvider), and then just swap the
> >> >> > dataProvider of the component to point to the newly populated
> >> >> > ArrayCollection instead
> >> >> > 2. Or call "thefunctionthatdisabledautoupdates" in advance (don't
> >> >> remember
> >> >> > the exact name right now) on the bound arraycollection before
> >>starting
> >> >> > processing your XML, modify/update your arraycollection items, and
> >> >>then
> >> >> > enabling it afterwards.
> >> >> >
> >> >> > P.S. "myCollection.disableAutoUpdate(); ", that was it :)
> >> >> >
> >> >>
> >> >>
> >>
> >>
> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668
> >> >>d2-7fe7.html
> >> >> >
> >> >> > P.P.S. If none of that applies.... would some kind of "pagination"
> >>on
> >> >>the
> >> >> > UI solve it?
> >> >> >
> >> >> > On Thu, Jun 25, 2015 at 3:52 PM, mark goldin
> >><ma...@gmail.com>
> >> >> > wrote:
> >> >> >
> >> >> >> I have a large xml data that UI needs to process. I am getting the
> >> >>above
> >> >> >> message about timing out. Not sure I can break my function into
> >> >>smaller
> >> >> >> pieces. Any other idea?
> >> >> >>
> >> >> >> Thanks
> >> >> >>
> >> >> >
> >> >> >
> >> >>
> >>
> >>
>
>

Re: A script has executed for longer than ....

Posted by Alex Harui <ah...@adobe.com>.
What work is done in processXML?  Step through it and make sure you are
done quickly and it gets called many times.

On 6/26/15, 2:04 AM, "mark goldin" <ma...@gmail.com> wrote:

>Ok, I got it running but it still timing out.
>Here is some code:
>
>public function result(data:Object):void
>{
> var re:ResultEvent = ResultEvent(data);
>thread = new
>PseudoThread(UIComponent(Application.application).systemManager,
>processXML, re.result.resultData);
>}
>private function processXML(resultData:XMLList):void
>
>Did not change anything in PseudoThread.
>
>On Thu, Jun 25, 2015 at 3:39 PM Alex Harui <ah...@adobe.com> wrote:
>
>> In Flex 3, mx.core.Application.application from anywhere should give you
>> access to the Application and thus its stage.
>>
>> In Flex 4, use FlexGlobals.topLevelApplication.
>>
>> -Alex
>>
>> On 6/25/15, 10:59 AM, "mark goldin" <ma...@gmail.com> wrote:
>>
>> >Alex, I need to use it from a command class that does not have
>> >systemManager or its stages. How do I go about it?
>> >
>> >On Thu, Jun 25, 2015 at 11:34 AM Javier Guerrero García
>> ><ja...@gmail.com>
>> >wrote:
>> >
>> >> More on that:
>> >>
>> >>
>> >>
>> 
>>http://www.jamesward.com/2008/11/21/drunk-on-software-episode-3-performan
>> >>ce-pitfalls-of-flexs-arraycollection/
>> >>
>> >> On Thu, Jun 25, 2015 at 6:29 PM, Javier Guerrero García
>> >><javi.gg@gmail.com
>> >> >
>> >> wrote:
>> >>
>> >> > Hi Mark:
>> >> >
>> >> > A long shot here: are you sure that, while you are processing the
>>XML,
>> >> > you're NOT triggering constant UI updates on each operation? For
>> >> instance:
>> >> > if after processing each XML item, you are adding the final result
>>to
>> >>an
>> >> > ArrayCollection, and you have some rendering component bound to
>>that
>> >> > ArrayCollection, that could cause a total repaint of the item
>> >>renderers
>> >> FOR
>> >> > EACH XML ITEM processed, hence causing the timeout. Something
>>similar
>> >> > happened to me a while ago, and after noticing and solving it, I
>>can
>> >>say
>> >> > that 60 seconds are more than enough to process a few hundreds of
>> >> thousand
>> >> > XML items, and unless your XML is REALLY huge that should be
>>enough :)
>> >> >
>> >> > If that applies, the obvious workaround is:
>> >> >
>> >> > 1. Do all your updates and additions on a new ArrayCollection (not
>>on
>> >>the
>> >> > one bound to the component's dataProvider), and then just swap the
>> >> > dataProvider of the component to point to the newly populated
>> >> > ArrayCollection instead
>> >> > 2. Or call "thefunctionthatdisabledautoupdates" in advance (don't
>> >> remember
>> >> > the exact name right now) on the bound arraycollection before
>>starting
>> >> > processing your XML, modify/update your arraycollection items, and
>> >>then
>> >> > enabling it afterwards.
>> >> >
>> >> > P.S. "myCollection.disableAutoUpdate(); ", that was it :)
>> >> >
>> >>
>> >>
>> 
>>http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668
>> >>d2-7fe7.html
>> >> >
>> >> > P.P.S. If none of that applies.... would some kind of "pagination"
>>on
>> >>the
>> >> > UI solve it?
>> >> >
>> >> > On Thu, Jun 25, 2015 at 3:52 PM, mark goldin
>><ma...@gmail.com>
>> >> > wrote:
>> >> >
>> >> >> I have a large xml data that UI needs to process. I am getting the
>> >>above
>> >> >> message about timing out. Not sure I can break my function into
>> >>smaller
>> >> >> pieces. Any other idea?
>> >> >>
>> >> >> Thanks
>> >> >>
>> >> >
>> >> >
>> >>
>>
>>


Re: A script has executed for longer than ....

Posted by mark goldin <ma...@gmail.com>.
Ok, I got it running but it still timing out.
Here is some code:

public function result(data:Object):void
{
 var re:ResultEvent = ResultEvent(data);
thread = new
PseudoThread(UIComponent(Application.application).systemManager,
processXML, re.result.resultData);
}
private function processXML(resultData:XMLList):void

Did not change anything in PseudoThread.

On Thu, Jun 25, 2015 at 3:39 PM Alex Harui <ah...@adobe.com> wrote:

> In Flex 3, mx.core.Application.application from anywhere should give you
> access to the Application and thus its stage.
>
> In Flex 4, use FlexGlobals.topLevelApplication.
>
> -Alex
>
> On 6/25/15, 10:59 AM, "mark goldin" <ma...@gmail.com> wrote:
>
> >Alex, I need to use it from a command class that does not have
> >systemManager or its stages. How do I go about it?
> >
> >On Thu, Jun 25, 2015 at 11:34 AM Javier Guerrero García
> ><ja...@gmail.com>
> >wrote:
> >
> >> More on that:
> >>
> >>
> >>
> http://www.jamesward.com/2008/11/21/drunk-on-software-episode-3-performan
> >>ce-pitfalls-of-flexs-arraycollection/
> >>
> >> On Thu, Jun 25, 2015 at 6:29 PM, Javier Guerrero García
> >><javi.gg@gmail.com
> >> >
> >> wrote:
> >>
> >> > Hi Mark:
> >> >
> >> > A long shot here: are you sure that, while you are processing the XML,
> >> > you're NOT triggering constant UI updates on each operation? For
> >> instance:
> >> > if after processing each XML item, you are adding the final result to
> >>an
> >> > ArrayCollection, and you have some rendering component bound to that
> >> > ArrayCollection, that could cause a total repaint of the item
> >>renderers
> >> FOR
> >> > EACH XML ITEM processed, hence causing the timeout. Something similar
> >> > happened to me a while ago, and after noticing and solving it, I can
> >>say
> >> > that 60 seconds are more than enough to process a few hundreds of
> >> thousand
> >> > XML items, and unless your XML is REALLY huge that should be enough :)
> >> >
> >> > If that applies, the obvious workaround is:
> >> >
> >> > 1. Do all your updates and additions on a new ArrayCollection (not on
> >>the
> >> > one bound to the component's dataProvider), and then just swap the
> >> > dataProvider of the component to point to the newly populated
> >> > ArrayCollection instead
> >> > 2. Or call "thefunctionthatdisabledautoupdates" in advance (don't
> >> remember
> >> > the exact name right now) on the bound arraycollection before starting
> >> > processing your XML, modify/update your arraycollection items, and
> >>then
> >> > enabling it afterwards.
> >> >
> >> > P.S. "myCollection.disableAutoUpdate(); ", that was it :)
> >> >
> >>
> >>
> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668
> >>d2-7fe7.html
> >> >
> >> > P.P.S. If none of that applies.... would some kind of "pagination" on
> >>the
> >> > UI solve it?
> >> >
> >> > On Thu, Jun 25, 2015 at 3:52 PM, mark goldin <ma...@gmail.com>
> >> > wrote:
> >> >
> >> >> I have a large xml data that UI needs to process. I am getting the
> >>above
> >> >> message about timing out. Not sure I can break my function into
> >>smaller
> >> >> pieces. Any other idea?
> >> >>
> >> >> Thanks
> >> >>
> >> >
> >> >
> >>
>
>

RE: A script has executed for longer than ....

Posted by Frédéric THOMAS <we...@hotmail.com>.
> In Flex 3, mx.core.Application.application from anywhere should give you
> access to the Application and thus its stage.
>
> In Flex 4, use FlexGlobals.topLevelApplication.

Ah yes, a check I should do in easyWorker too if I want it compatible with Flex 3.

Thanks,
Frédéric THOMAS


----------------------------------------
> From: aharui@adobe.com
> To: users@flex.apache.org
> Subject: Re: A script has executed for longer than ....
> Date: Thu, 25 Jun 2015 20:38:59 +0000
>
> In Flex 3, mx.core.Application.application from anywhere should give you
> access to the Application and thus its stage.
>
> In Flex 4, use FlexGlobals.topLevelApplication.
>
> -Alex
>
> On 6/25/15, 10:59 AM, "mark goldin" <ma...@gmail.com> wrote:
>
>>Alex, I need to use it from a command class that does not have
>>systemManager or its stages. How do I go about it?
>>
>>On Thu, Jun 25, 2015 at 11:34 AM Javier Guerrero García
>><ja...@gmail.com>
>>wrote:
>>
>>> More on that:
>>>
>>>
>>>http://www.jamesward.com/2008/11/21/drunk-on-software-episode-3-performan
>>>ce-pitfalls-of-flexs-arraycollection/
>>>
>>> On Thu, Jun 25, 2015 at 6:29 PM, Javier Guerrero García
>>><javi.gg@gmail.com
>>>>
>>> wrote:
>>>
>>>> Hi Mark:
>>>>
>>>> A long shot here: are you sure that, while you are processing the XML,
>>>> you're NOT triggering constant UI updates on each operation? For
>>> instance:
>>>> if after processing each XML item, you are adding the final result to
>>>an
>>>> ArrayCollection, and you have some rendering component bound to that
>>>> ArrayCollection, that could cause a total repaint of the item
>>>renderers
>>> FOR
>>>> EACH XML ITEM processed, hence causing the timeout. Something similar
>>>> happened to me a while ago, and after noticing and solving it, I can
>>>say
>>>> that 60 seconds are more than enough to process a few hundreds of
>>> thousand
>>>> XML items, and unless your XML is REALLY huge that should be enough :)
>>>>
>>>> If that applies, the obvious workaround is:
>>>>
>>>> 1. Do all your updates and additions on a new ArrayCollection (not on
>>>the
>>>> one bound to the component's dataProvider), and then just swap the
>>>> dataProvider of the component to point to the newly populated
>>>> ArrayCollection instead
>>>> 2. Or call "thefunctionthatdisabledautoupdates" in advance (don't
>>> remember
>>>> the exact name right now) on the bound arraycollection before starting
>>>> processing your XML, modify/update your arraycollection items, and
>>>then
>>>> enabling it afterwards.
>>>>
>>>> P.S. "myCollection.disableAutoUpdate(); ", that was it :)
>>>>
>>>
>>>http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668
>>>d2-7fe7.html
>>>>
>>>> P.P.S. If none of that applies.... would some kind of "pagination" on
>>>the
>>>> UI solve it?
>>>>
>>>> On Thu, Jun 25, 2015 at 3:52 PM, mark goldin <ma...@gmail.com>
>>>> wrote:
>>>>
>>>>> I have a large xml data that UI needs to process. I am getting the
>>>above
>>>>> message about timing out. Not sure I can break my function into
>>>smaller
>>>>> pieces. Any other idea?
>>>>>
>>>>> Thanks
>>>>>
>>>>
>>>>
>>>
>
 		 	   		  

Re: A script has executed for longer than ....

Posted by Alex Harui <ah...@adobe.com>.
In Flex 3, mx.core.Application.application from anywhere should give you
access to the Application and thus its stage.

In Flex 4, use FlexGlobals.topLevelApplication.

-Alex

On 6/25/15, 10:59 AM, "mark goldin" <ma...@gmail.com> wrote:

>Alex, I need to use it from a command class that does not have
>systemManager or its stages. How do I go about it?
>
>On Thu, Jun 25, 2015 at 11:34 AM Javier Guerrero García
><ja...@gmail.com>
>wrote:
>
>> More on that:
>>
>> 
>>http://www.jamesward.com/2008/11/21/drunk-on-software-episode-3-performan
>>ce-pitfalls-of-flexs-arraycollection/
>>
>> On Thu, Jun 25, 2015 at 6:29 PM, Javier Guerrero García
>><javi.gg@gmail.com
>> >
>> wrote:
>>
>> > Hi Mark:
>> >
>> > A long shot here: are you sure that, while you are processing the XML,
>> > you're NOT triggering constant UI updates on each operation? For
>> instance:
>> > if after processing each XML item, you are adding the final result to
>>an
>> > ArrayCollection, and you have some rendering component bound to that
>> > ArrayCollection, that could cause a total repaint of the item
>>renderers
>> FOR
>> > EACH XML ITEM processed, hence causing the timeout. Something similar
>> > happened to me a while ago, and after noticing and solving it, I can
>>say
>> > that 60 seconds are more than enough to process a few hundreds of
>> thousand
>> > XML items, and unless your XML is REALLY huge that should be enough :)
>> >
>> > If that applies, the obvious workaround is:
>> >
>> > 1. Do all your updates and additions on a new ArrayCollection (not on
>>the
>> > one bound to the component's dataProvider), and then just swap the
>> > dataProvider of the component to point to the newly populated
>> > ArrayCollection instead
>> > 2. Or call "thefunctionthatdisabledautoupdates" in advance (don't
>> remember
>> > the exact name right now) on the bound arraycollection before starting
>> > processing your XML, modify/update your arraycollection items, and
>>then
>> > enabling it afterwards.
>> >
>> > P.S. "myCollection.disableAutoUpdate(); ", that was it :)
>> >
>> 
>>http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668
>>d2-7fe7.html
>> >
>> > P.P.S. If none of that applies.... would some kind of "pagination" on
>>the
>> > UI solve it?
>> >
>> > On Thu, Jun 25, 2015 at 3:52 PM, mark goldin <ma...@gmail.com>
>> > wrote:
>> >
>> >> I have a large xml data that UI needs to process. I am getting the
>>above
>> >> message about timing out. Not sure I can break my function into
>>smaller
>> >> pieces. Any other idea?
>> >>
>> >> Thanks
>> >>
>> >
>> >
>>


Re: A script has executed for longer than ....

Posted by mark goldin <ma...@gmail.com>.
Alex, I need to use it from a command class that does not have
systemManager or its stages. How do I go about it?

On Thu, Jun 25, 2015 at 11:34 AM Javier Guerrero García <ja...@gmail.com>
wrote:

> More on that:
>
> http://www.jamesward.com/2008/11/21/drunk-on-software-episode-3-performance-pitfalls-of-flexs-arraycollection/
>
> On Thu, Jun 25, 2015 at 6:29 PM, Javier Guerrero García <javi.gg@gmail.com
> >
> wrote:
>
> > Hi Mark:
> >
> > A long shot here: are you sure that, while you are processing the XML,
> > you're NOT triggering constant UI updates on each operation? For
> instance:
> > if after processing each XML item, you are adding the final result to an
> > ArrayCollection, and you have some rendering component bound to that
> > ArrayCollection, that could cause a total repaint of the item renderers
> FOR
> > EACH XML ITEM processed, hence causing the timeout. Something similar
> > happened to me a while ago, and after noticing and solving it, I can say
> > that 60 seconds are more than enough to process a few hundreds of
> thousand
> > XML items, and unless your XML is REALLY huge that should be enough :)
> >
> > If that applies, the obvious workaround is:
> >
> > 1. Do all your updates and additions on a new ArrayCollection (not on the
> > one bound to the component's dataProvider), and then just swap the
> > dataProvider of the component to point to the newly populated
> > ArrayCollection instead
> > 2. Or call "thefunctionthatdisabledautoupdates" in advance (don't
> remember
> > the exact name right now) on the bound arraycollection before starting
> > processing your XML, modify/update your arraycollection items, and then
> > enabling it afterwards.
> >
> > P.S. "myCollection.disableAutoUpdate(); ", that was it :)
> >
> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668d2-7fe7.html
> >
> > P.P.S. If none of that applies.... would some kind of "pagination" on the
> > UI solve it?
> >
> > On Thu, Jun 25, 2015 at 3:52 PM, mark goldin <ma...@gmail.com>
> > wrote:
> >
> >> I have a large xml data that UI needs to process. I am getting the above
> >> message about timing out. Not sure I can break my function into smaller
> >> pieces. Any other idea?
> >>
> >> Thanks
> >>
> >
> >
>

Re: A script has executed for longer than ....

Posted by Javier Guerrero García <ja...@gmail.com>.
More on that:
http://www.jamesward.com/2008/11/21/drunk-on-software-episode-3-performance-pitfalls-of-flexs-arraycollection/

On Thu, Jun 25, 2015 at 6:29 PM, Javier Guerrero García <ja...@gmail.com>
wrote:

> Hi Mark:
>
> A long shot here: are you sure that, while you are processing the XML,
> you're NOT triggering constant UI updates on each operation? For instance:
> if after processing each XML item, you are adding the final result to an
> ArrayCollection, and you have some rendering component bound to that
> ArrayCollection, that could cause a total repaint of the item renderers FOR
> EACH XML ITEM processed, hence causing the timeout. Something similar
> happened to me a while ago, and after noticing and solving it, I can say
> that 60 seconds are more than enough to process a few hundreds of thousand
> XML items, and unless your XML is REALLY huge that should be enough :)
>
> If that applies, the obvious workaround is:
>
> 1. Do all your updates and additions on a new ArrayCollection (not on the
> one bound to the component's dataProvider), and then just swap the
> dataProvider of the component to point to the newly populated
> ArrayCollection instead
> 2. Or call "thefunctionthatdisabledautoupdates" in advance (don't remember
> the exact name right now) on the bound arraycollection before starting
> processing your XML, modify/update your arraycollection items, and then
> enabling it afterwards.
>
> P.S. "myCollection.disableAutoUpdate(); ", that was it :)
> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668d2-7fe7.html
>
> P.P.S. If none of that applies.... would some kind of "pagination" on the
> UI solve it?
>
> On Thu, Jun 25, 2015 at 3:52 PM, mark goldin <ma...@gmail.com>
> wrote:
>
>> I have a large xml data that UI needs to process. I am getting the above
>> message about timing out. Not sure I can break my function into smaller
>> pieces. Any other idea?
>>
>> Thanks
>>
>
>

Re: A script has executed for longer than ....

Posted by Javier Guerrero García <ja...@gmail.com>.
Hi Mark:

A long shot here: are you sure that, while you are processing the XML,
you're NOT triggering constant UI updates on each operation? For instance:
if after processing each XML item, you are adding the final result to an
ArrayCollection, and you have some rendering component bound to that
ArrayCollection, that could cause a total repaint of the item renderers FOR
EACH XML ITEM processed, hence causing the timeout. Something similar
happened to me a while ago, and after noticing and solving it, I can say
that 60 seconds are more than enough to process a few hundreds of thousand
XML items, and unless your XML is REALLY huge that should be enough :)

If that applies, the obvious workaround is:

1. Do all your updates and additions on a new ArrayCollection (not on the
one bound to the component's dataProvider), and then just swap the
dataProvider of the component to point to the newly populated
ArrayCollection instead
2. Or call "thefunctionthatdisabledautoupdates" in advance (don't remember
the exact name right now) on the bound arraycollection before starting
processing your XML, modify/update your arraycollection items, and then
enabling it afterwards.

P.S. "myCollection.disableAutoUpdate(); ", that was it :)
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668d2-7fe7.html

P.P.S. If none of that applies.... would some kind of "pagination" on the
UI solve it?

On Thu, Jun 25, 2015 at 3:52 PM, mark goldin <ma...@gmail.com> wrote:

> I have a large xml data that UI needs to process. I am getting the above
> message about timing out. Not sure I can break my function into smaller
> pieces. Any other idea?
>
> Thanks
>

Re: A script has executed for longer than ....

Posted by OmPrakash Muppirala <bi...@gmail.com>.
You can also use AS3 Workers.

Thanks,
Om
On Jun 25, 2015 7:46 AM, "mark goldin" <ma...@gmail.com> wrote:

> I see. Alex, I am looking into the article you have provided. Just a quick
> question. Where do I put my code to process xml? Because you code is
> rendering screen I am not sure how to adapt your code to my needs.
>
> On Thu, Jun 25, 2015 at 9:33 AM Alex Harui <ah...@adobe.com> wrote:
>
> > That sounds like pseudo-threading.  You would have to break it up in one
> > frame, handle chunks in separate frames, and assemble in the last frame.
> > With pseudo-threading, you don’t have to break it up and lose parenting
> > and re-assemble, you just keep some state around, and process chunks in
> > each frame.
> >
> > -Alex
> >
> > On 6/25/15, 7:20 AM, "mark goldin" <ma...@gmail.com> wrote:
> >
> > >What if I break xml into pieces for separate processing and then put
> them
> > >together into one final xml?
> > >
> > >On Thu, Jun 25, 2015 at 9:12 AM Alex Harui <ah...@adobe.com> wrote:
> > >
> > >> Well, xml is terribly slow.  If you can server-side process it into
> > >> something else (RemoteObject/AMF to ValueObjects is considered to be
> the
> > >> fastest, ObjectProxy is also slow, JSON might be fast) then you might
> be
> > >> able to process all of the data in 60 seconds in ActionScript.
> However,
> > >> if one of your customers happens to be running a virus scan or some
> > >>other
> > >> heavy job at the same time, you might find it exceeds 60 seconds
> anyway.
> > >>
> > >> Workers or Pseudo-threading [1] might help you.  Also having the
> server
> > >>do
> > >> the processing and send you the results.
> > >>
> > >> -Alex
> > >>
> > >> [1]
> > http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html
> > >>
> > >> On 6/25/15, 6:52 AM, "mark goldin" <ma...@gmail.com> wrote:
> > >>
> > >> >I have a large xml data that UI needs to process. I am getting the
> > >>above
> > >> >message about timing out. Not sure I can break my function into
> smaller
> > >> >pieces. Any other idea?
> > >> >
> > >> >Thanks
> > >>
> > >>
> >
> >
>

Re: A script has executed for longer than ....

Posted by Alex Harui <ah...@adobe.com>.

On 6/25/15, 8:17 AM, "mark goldin" <ma...@gmail.com> wrote:

>In the threadCompleteHandler function?

threadCompleteHandler is called when your callback function returns false.

The callback function is a function you pass into PseudoThread.

-Alex

>
>On Thu, Jun 25, 2015 at 10:03 AM Alex Harui <ah...@adobe.com> wrote:
>
>> In the callback function.  The callback function would probably process
>> some node and update variables so when it gets called again it knows to
>> process a different node.
>>
>> On 6/25/15, 7:46 AM, "mark goldin" <ma...@gmail.com> wrote:
>>
>> >I see. Alex, I am looking into the article you have provided. Just a
>>quick
>> >question. Where do I put my code to process xml? Because you code is
>> >rendering screen I am not sure how to adapt your code to my needs.
>> >
>> >On Thu, Jun 25, 2015 at 9:33 AM Alex Harui <ah...@adobe.com> wrote:
>> >
>> >> That sounds like pseudo-threading.  You would have to break it up in
>>one
>> >> frame, handle chunks in separate frames, and assemble in the last
>>frame.
>> >> With pseudo-threading, you don’t have to break it up and lose
>>parenting
>> >> and re-assemble, you just keep some state around, and process chunks
>>in
>> >> each frame.
>> >>
>> >> -Alex
>> >>
>> >> On 6/25/15, 7:20 AM, "mark goldin" <ma...@gmail.com> wrote:
>> >>
>> >> >What if I break xml into pieces for separate processing and then put
>> >>them
>> >> >together into one final xml?
>> >> >
>> >> >On Thu, Jun 25, 2015 at 9:12 AM Alex Harui <ah...@adobe.com> wrote:
>> >> >
>> >> >> Well, xml is terribly slow.  If you can server-side process it
>>into
>> >> >> something else (RemoteObject/AMF to ValueObjects is considered to
>>be
>> >>the
>> >> >> fastest, ObjectProxy is also slow, JSON might be fast) then you
>> >>might be
>> >> >> able to process all of the data in 60 seconds in ActionScript.
>> >>However,
>> >> >> if one of your customers happens to be running a virus scan or
>>some
>> >> >>other
>> >> >> heavy job at the same time, you might find it exceeds 60 seconds
>> >>anyway.
>> >> >>
>> >> >> Workers or Pseudo-threading [1] might help you.  Also having the
>> >>server
>> >> >>do
>> >> >> the processing and send you the results.
>> >> >>
>> >> >> -Alex
>> >> >>
>> >> >> [1]
>> >> http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html
>> >> >>
>> >> >> On 6/25/15, 6:52 AM, "mark goldin" <ma...@gmail.com> wrote:
>> >> >>
>> >> >> >I have a large xml data that UI needs to process. I am getting
>>the
>> >> >>above
>> >> >> >message about timing out. Not sure I can break my function into
>> >>smaller
>> >> >> >pieces. Any other idea?
>> >> >> >
>> >> >> >Thanks
>> >> >>
>> >> >>
>> >>
>> >>
>>
>>


Re: A script has executed for longer than ....

Posted by phil gottfried <ph...@rwcdigitalgraphics.com>.
I am a bit confused by this thread.

Is the timeout from a server or is that actionscript causing the timeout.

Did the server code actually execute or is there a 2032 error?

I have never seen an actionscript statement timeout, only calls to servers. ie a fault response


If your remote data is causing a timeout, it is because the server had not finished.

There are three options I have used.

1. compress the response with gzip.

2. post the request and write the data to a file on the server and then in the response indicate the location to download with urlstream load command and its progress and complete functions.

3.  use a post/response where
	a. post the initial request
	b. get response with the data and a flag for the a state like start,more,last.
	c. when response is start, initialize data from response, post more request.
	d. when response is more, accumulate data from response, post more request.
	e. when response is last, finalize data from response,		

I found that on the server side, it can be faster to compress the xml response instead of an serialized AMF response.
It really depends on the code on the server that performs serialization.  My testing was done using AMFPHP, so a native application for the AMF on the server would be fastest. 


Phil Gottfried
Art Director
RWC Digital Graphics
2920 Edith Lane
Haltom City, Texas 76117
Ph: 817 831 2300
Fx: 817 831 2302
phil@rwcdigitalgraphics.com

Upload your files here!  http://www.rwcdigitalgraphics.com/rwc_10.html

http://upload.youload.com/hJw7d0w691TNQ1UrZ9j5gw==/



RE: A script has executed for longer than ....

Posted by Frédéric THOMAS <we...@hotmail.com>.
> Can I implement workers if I use Flex 3 with 4.13 SDK?

If you want to use https://github.com/doublefx/easyWorker, the minimum is Apache Flex 4.13.0 FP 11.5 AIR 3.5, for Flex 3, I guess yes too as the only added class was in core IIRC

Frédéric THOMAS


----------------------------------------
> From: markzolotoy@gmail.com
> Date: Thu, 25 Jun 2015 15:35:59 +0000
> Subject: Re: A script has executed for longer than ....
> To: users@flex.apache.org
>
> Can I implement workers if I use Flex 3 with 4.13 SDK?
>
> On Thu, Jun 25, 2015 at 10:29 AM Frédéric THOMAS <we...@hotmail.com>
> wrote:
>
>>> In the threadCompleteHandler function?
>>
>> Worker and Pseudo-Worker are low level API from which you can certainly
>> achieve your goal, if you prefer to use an easier Thread like API, you can
>> download an compile https://github.com/doublefx/easyWorker
>>
>> Using it, I would probably create a Thread lib containing only the classes
>> an functions you need, instantiate it at application / module startup or
>> even create a pool of Threads and use it whenever you will receive your
>> data.
>>
>> Frédéric THOMAS
>>
>>
>> ----------------------------------------
>>> From: markzolotoy@gmail.com
>>> Date: Thu, 25 Jun 2015 15:17:43 +0000
>>> Subject: Re: A script has executed for longer than ....
>>> To: users@flex.apache.org
>>>
>>> In the threadCompleteHandler function?
>>>
>>> On Thu, Jun 25, 2015 at 10:03 AM Alex Harui <ah...@adobe.com> wrote:
>>>
>>>> In the callback function. The callback function would probably process
>>>> some node and update variables so when it gets called again it knows to
>>>> process a different node.
>>>>
>>>> On 6/25/15, 7:46 AM, "mark goldin" <ma...@gmail.com> wrote:
>>>>
>>>>>I see. Alex, I am looking into the article you have provided. Just a
>> quick
>>>>>question. Where do I put my code to process xml? Because you code is
>>>>>rendering screen I am not sure how to adapt your code to my needs.
>>>>>
>>>>>On Thu, Jun 25, 2015 at 9:33 AM Alex Harui <ah...@adobe.com> wrote:
>>>>>
>>>>>> That sounds like pseudo-threading. You would have to break it up in
>> one
>>>>>> frame, handle chunks in separate frames, and assemble in the last
>> frame.
>>>>>> With pseudo-threading, you don’t have to break it up and lose
>> parenting
>>>>>> and re-assemble, you just keep some state around, and process chunks
>> in
>>>>>> each frame.
>>>>>>
>>>>>> -Alex
>>>>>>
>>>>>> On 6/25/15, 7:20 AM, "mark goldin" <ma...@gmail.com> wrote:
>>>>>>
>>>>>>>What if I break xml into pieces for separate processing and then put
>>>>>>them
>>>>>>>together into one final xml?
>>>>>>>
>>>>>>>On Thu, Jun 25, 2015 at 9:12 AM Alex Harui <ah...@adobe.com> wrote:
>>>>>>>
>>>>>>>> Well, xml is terribly slow. If you can server-side process it into
>>>>>>>> something else (RemoteObject/AMF to ValueObjects is considered to be
>>>>>>the
>>>>>>>> fastest, ObjectProxy is also slow, JSON might be fast) then you
>>>>>>might be
>>>>>>>> able to process all of the data in 60 seconds in ActionScript.
>>>>>>However,
>>>>>>>> if one of your customers happens to be running a virus scan or some
>>>>>>>>other
>>>>>>>> heavy job at the same time, you might find it exceeds 60 seconds
>>>>>>anyway.
>>>>>>>>
>>>>>>>> Workers or Pseudo-threading [1] might help you. Also having the
>>>>>>server
>>>>>>>>do
>>>>>>>> the processing and send you the results.
>>>>>>>>
>>>>>>>> -Alex
>>>>>>>>
>>>>>>>> [1]
>>>>>> http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html
>>>>>>>>
>>>>>>>> On 6/25/15, 6:52 AM, "mark goldin" <ma...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>>I have a large xml data that UI needs to process. I am getting the
>>>>>>>>above
>>>>>>>>>message about timing out. Not sure I can break my function into
>>>>>>smaller
>>>>>>>>>pieces. Any other idea?
>>>>>>>>>
>>>>>>>>>Thanks
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
 		 	   		  

Re: A script has executed for longer than ....

Posted by mark goldin <ma...@gmail.com>.
Can I implement workers if I use Flex 3 with 4.13 SDK?

On Thu, Jun 25, 2015 at 10:29 AM Frédéric THOMAS <we...@hotmail.com>
wrote:

> > In the threadCompleteHandler function?
>
> Worker and Pseudo-Worker are low level API from which you can certainly
> achieve your goal, if you prefer to use an easier Thread like API, you can
> download an compile https://github.com/doublefx/easyWorker
>
> Using it, I would probably create a Thread lib containing only the classes
> an functions you need, instantiate it at application / module startup or
> even create a pool of Threads and use it whenever you will receive your
> data.
>
> Frédéric THOMAS
>
>
> ----------------------------------------
> > From: markzolotoy@gmail.com
> > Date: Thu, 25 Jun 2015 15:17:43 +0000
> > Subject: Re: A script has executed for longer than ....
> > To: users@flex.apache.org
> >
> > In the threadCompleteHandler function?
> >
> > On Thu, Jun 25, 2015 at 10:03 AM Alex Harui <ah...@adobe.com> wrote:
> >
> >> In the callback function. The callback function would probably process
> >> some node and update variables so when it gets called again it knows to
> >> process a different node.
> >>
> >> On 6/25/15, 7:46 AM, "mark goldin" <ma...@gmail.com> wrote:
> >>
> >>>I see. Alex, I am looking into the article you have provided. Just a
> quick
> >>>question. Where do I put my code to process xml? Because you code is
> >>>rendering screen I am not sure how to adapt your code to my needs.
> >>>
> >>>On Thu, Jun 25, 2015 at 9:33 AM Alex Harui <ah...@adobe.com> wrote:
> >>>
> >>>> That sounds like pseudo-threading. You would have to break it up in
> one
> >>>> frame, handle chunks in separate frames, and assemble in the last
> frame.
> >>>> With pseudo-threading, you don’t have to break it up and lose
> parenting
> >>>> and re-assemble, you just keep some state around, and process chunks
> in
> >>>> each frame.
> >>>>
> >>>> -Alex
> >>>>
> >>>> On 6/25/15, 7:20 AM, "mark goldin" <ma...@gmail.com> wrote:
> >>>>
> >>>>>What if I break xml into pieces for separate processing and then put
> >>>>them
> >>>>>together into one final xml?
> >>>>>
> >>>>>On Thu, Jun 25, 2015 at 9:12 AM Alex Harui <ah...@adobe.com> wrote:
> >>>>>
> >>>>>> Well, xml is terribly slow. If you can server-side process it into
> >>>>>> something else (RemoteObject/AMF to ValueObjects is considered to be
> >>>>the
> >>>>>> fastest, ObjectProxy is also slow, JSON might be fast) then you
> >>>>might be
> >>>>>> able to process all of the data in 60 seconds in ActionScript.
> >>>>However,
> >>>>>> if one of your customers happens to be running a virus scan or some
> >>>>>>other
> >>>>>> heavy job at the same time, you might find it exceeds 60 seconds
> >>>>anyway.
> >>>>>>
> >>>>>> Workers or Pseudo-threading [1] might help you. Also having the
> >>>>server
> >>>>>>do
> >>>>>> the processing and send you the results.
> >>>>>>
> >>>>>> -Alex
> >>>>>>
> >>>>>> [1]
> >>>> http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html
> >>>>>>
> >>>>>> On 6/25/15, 6:52 AM, "mark goldin" <ma...@gmail.com> wrote:
> >>>>>>
> >>>>>>>I have a large xml data that UI needs to process. I am getting the
> >>>>>>above
> >>>>>>>message about timing out. Not sure I can break my function into
> >>>>smaller
> >>>>>>>pieces. Any other idea?
> >>>>>>>
> >>>>>>>Thanks
> >>>>>>
> >>>>>>
> >>>>
> >>>>
> >>
> >>
>

RE: A script has executed for longer than ....

Posted by Frédéric THOMAS <we...@hotmail.com>.
> In the threadCompleteHandler function?

Worker and Pseudo-Worker are low level API from which you can certainly achieve your goal, if you prefer to use an easier Thread like API, you can download an compile https://github.com/doublefx/easyWorker

Using it, I would probably create a Thread lib containing only the classes an functions you need, instantiate it at application / module startup or even create a pool of Threads and use it whenever you will receive your data.

Frédéric THOMAS


----------------------------------------
> From: markzolotoy@gmail.com
> Date: Thu, 25 Jun 2015 15:17:43 +0000
> Subject: Re: A script has executed for longer than ....
> To: users@flex.apache.org
>
> In the threadCompleteHandler function?
>
> On Thu, Jun 25, 2015 at 10:03 AM Alex Harui <ah...@adobe.com> wrote:
>
>> In the callback function. The callback function would probably process
>> some node and update variables so when it gets called again it knows to
>> process a different node.
>>
>> On 6/25/15, 7:46 AM, "mark goldin" <ma...@gmail.com> wrote:
>>
>>>I see. Alex, I am looking into the article you have provided. Just a quick
>>>question. Where do I put my code to process xml? Because you code is
>>>rendering screen I am not sure how to adapt your code to my needs.
>>>
>>>On Thu, Jun 25, 2015 at 9:33 AM Alex Harui <ah...@adobe.com> wrote:
>>>
>>>> That sounds like pseudo-threading. You would have to break it up in one
>>>> frame, handle chunks in separate frames, and assemble in the last frame.
>>>> With pseudo-threading, you don’t have to break it up and lose parenting
>>>> and re-assemble, you just keep some state around, and process chunks in
>>>> each frame.
>>>>
>>>> -Alex
>>>>
>>>> On 6/25/15, 7:20 AM, "mark goldin" <ma...@gmail.com> wrote:
>>>>
>>>>>What if I break xml into pieces for separate processing and then put
>>>>them
>>>>>together into one final xml?
>>>>>
>>>>>On Thu, Jun 25, 2015 at 9:12 AM Alex Harui <ah...@adobe.com> wrote:
>>>>>
>>>>>> Well, xml is terribly slow. If you can server-side process it into
>>>>>> something else (RemoteObject/AMF to ValueObjects is considered to be
>>>>the
>>>>>> fastest, ObjectProxy is also slow, JSON might be fast) then you
>>>>might be
>>>>>> able to process all of the data in 60 seconds in ActionScript.
>>>>However,
>>>>>> if one of your customers happens to be running a virus scan or some
>>>>>>other
>>>>>> heavy job at the same time, you might find it exceeds 60 seconds
>>>>anyway.
>>>>>>
>>>>>> Workers or Pseudo-threading [1] might help you. Also having the
>>>>server
>>>>>>do
>>>>>> the processing and send you the results.
>>>>>>
>>>>>> -Alex
>>>>>>
>>>>>> [1]
>>>> http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html
>>>>>>
>>>>>> On 6/25/15, 6:52 AM, "mark goldin" <ma...@gmail.com> wrote:
>>>>>>
>>>>>>>I have a large xml data that UI needs to process. I am getting the
>>>>>>above
>>>>>>>message about timing out. Not sure I can break my function into
>>>>smaller
>>>>>>>pieces. Any other idea?
>>>>>>>
>>>>>>>Thanks
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
 		 	   		  

Re: A script has executed for longer than ....

Posted by mark goldin <ma...@gmail.com>.
In the threadCompleteHandler function?

On Thu, Jun 25, 2015 at 10:03 AM Alex Harui <ah...@adobe.com> wrote:

> In the callback function.  The callback function would probably process
> some node and update variables so when it gets called again it knows to
> process a different node.
>
> On 6/25/15, 7:46 AM, "mark goldin" <ma...@gmail.com> wrote:
>
> >I see. Alex, I am looking into the article you have provided. Just a quick
> >question. Where do I put my code to process xml? Because you code is
> >rendering screen I am not sure how to adapt your code to my needs.
> >
> >On Thu, Jun 25, 2015 at 9:33 AM Alex Harui <ah...@adobe.com> wrote:
> >
> >> That sounds like pseudo-threading.  You would have to break it up in one
> >> frame, handle chunks in separate frames, and assemble in the last frame.
> >> With pseudo-threading, you don’t have to break it up and lose parenting
> >> and re-assemble, you just keep some state around, and process chunks in
> >> each frame.
> >>
> >> -Alex
> >>
> >> On 6/25/15, 7:20 AM, "mark goldin" <ma...@gmail.com> wrote:
> >>
> >> >What if I break xml into pieces for separate processing and then put
> >>them
> >> >together into one final xml?
> >> >
> >> >On Thu, Jun 25, 2015 at 9:12 AM Alex Harui <ah...@adobe.com> wrote:
> >> >
> >> >> Well, xml is terribly slow.  If you can server-side process it into
> >> >> something else (RemoteObject/AMF to ValueObjects is considered to be
> >>the
> >> >> fastest, ObjectProxy is also slow, JSON might be fast) then you
> >>might be
> >> >> able to process all of the data in 60 seconds in ActionScript.
> >>However,
> >> >> if one of your customers happens to be running a virus scan or some
> >> >>other
> >> >> heavy job at the same time, you might find it exceeds 60 seconds
> >>anyway.
> >> >>
> >> >> Workers or Pseudo-threading [1] might help you.  Also having the
> >>server
> >> >>do
> >> >> the processing and send you the results.
> >> >>
> >> >> -Alex
> >> >>
> >> >> [1]
> >> http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html
> >> >>
> >> >> On 6/25/15, 6:52 AM, "mark goldin" <ma...@gmail.com> wrote:
> >> >>
> >> >> >I have a large xml data that UI needs to process. I am getting the
> >> >>above
> >> >> >message about timing out. Not sure I can break my function into
> >>smaller
> >> >> >pieces. Any other idea?
> >> >> >
> >> >> >Thanks
> >> >>
> >> >>
> >>
> >>
>
>

Re: A script has executed for longer than ....

Posted by Alex Harui <ah...@adobe.com>.
In the callback function.  The callback function would probably process
some node and update variables so when it gets called again it knows to
process a different node.

On 6/25/15, 7:46 AM, "mark goldin" <ma...@gmail.com> wrote:

>I see. Alex, I am looking into the article you have provided. Just a quick
>question. Where do I put my code to process xml? Because you code is
>rendering screen I am not sure how to adapt your code to my needs.
>
>On Thu, Jun 25, 2015 at 9:33 AM Alex Harui <ah...@adobe.com> wrote:
>
>> That sounds like pseudo-threading.  You would have to break it up in one
>> frame, handle chunks in separate frames, and assemble in the last frame.
>> With pseudo-threading, you don’t have to break it up and lose parenting
>> and re-assemble, you just keep some state around, and process chunks in
>> each frame.
>>
>> -Alex
>>
>> On 6/25/15, 7:20 AM, "mark goldin" <ma...@gmail.com> wrote:
>>
>> >What if I break xml into pieces for separate processing and then put
>>them
>> >together into one final xml?
>> >
>> >On Thu, Jun 25, 2015 at 9:12 AM Alex Harui <ah...@adobe.com> wrote:
>> >
>> >> Well, xml is terribly slow.  If you can server-side process it into
>> >> something else (RemoteObject/AMF to ValueObjects is considered to be
>>the
>> >> fastest, ObjectProxy is also slow, JSON might be fast) then you
>>might be
>> >> able to process all of the data in 60 seconds in ActionScript.
>>However,
>> >> if one of your customers happens to be running a virus scan or some
>> >>other
>> >> heavy job at the same time, you might find it exceeds 60 seconds
>>anyway.
>> >>
>> >> Workers or Pseudo-threading [1] might help you.  Also having the
>>server
>> >>do
>> >> the processing and send you the results.
>> >>
>> >> -Alex
>> >>
>> >> [1]
>> http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html
>> >>
>> >> On 6/25/15, 6:52 AM, "mark goldin" <ma...@gmail.com> wrote:
>> >>
>> >> >I have a large xml data that UI needs to process. I am getting the
>> >>above
>> >> >message about timing out. Not sure I can break my function into
>>smaller
>> >> >pieces. Any other idea?
>> >> >
>> >> >Thanks
>> >>
>> >>
>>
>>


Re: A script has executed for longer than ....

Posted by mark goldin <ma...@gmail.com>.
I see. Alex, I am looking into the article you have provided. Just a quick
question. Where do I put my code to process xml? Because you code is
rendering screen I am not sure how to adapt your code to my needs.

On Thu, Jun 25, 2015 at 9:33 AM Alex Harui <ah...@adobe.com> wrote:

> That sounds like pseudo-threading.  You would have to break it up in one
> frame, handle chunks in separate frames, and assemble in the last frame.
> With pseudo-threading, you don’t have to break it up and lose parenting
> and re-assemble, you just keep some state around, and process chunks in
> each frame.
>
> -Alex
>
> On 6/25/15, 7:20 AM, "mark goldin" <ma...@gmail.com> wrote:
>
> >What if I break xml into pieces for separate processing and then put them
> >together into one final xml?
> >
> >On Thu, Jun 25, 2015 at 9:12 AM Alex Harui <ah...@adobe.com> wrote:
> >
> >> Well, xml is terribly slow.  If you can server-side process it into
> >> something else (RemoteObject/AMF to ValueObjects is considered to be the
> >> fastest, ObjectProxy is also slow, JSON might be fast) then you might be
> >> able to process all of the data in 60 seconds in ActionScript.  However,
> >> if one of your customers happens to be running a virus scan or some
> >>other
> >> heavy job at the same time, you might find it exceeds 60 seconds anyway.
> >>
> >> Workers or Pseudo-threading [1] might help you.  Also having the server
> >>do
> >> the processing and send you the results.
> >>
> >> -Alex
> >>
> >> [1]
> http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html
> >>
> >> On 6/25/15, 6:52 AM, "mark goldin" <ma...@gmail.com> wrote:
> >>
> >> >I have a large xml data that UI needs to process. I am getting the
> >>above
> >> >message about timing out. Not sure I can break my function into smaller
> >> >pieces. Any other idea?
> >> >
> >> >Thanks
> >>
> >>
>
>

Re: A script has executed for longer than ....

Posted by Alex Harui <ah...@adobe.com>.
That sounds like pseudo-threading.  You would have to break it up in one
frame, handle chunks in separate frames, and assemble in the last frame.
With pseudo-threading, you don’t have to break it up and lose parenting
and re-assemble, you just keep some state around, and process chunks in
each frame.

-Alex

On 6/25/15, 7:20 AM, "mark goldin" <ma...@gmail.com> wrote:

>What if I break xml into pieces for separate processing and then put them
>together into one final xml?
>
>On Thu, Jun 25, 2015 at 9:12 AM Alex Harui <ah...@adobe.com> wrote:
>
>> Well, xml is terribly slow.  If you can server-side process it into
>> something else (RemoteObject/AMF to ValueObjects is considered to be the
>> fastest, ObjectProxy is also slow, JSON might be fast) then you might be
>> able to process all of the data in 60 seconds in ActionScript.  However,
>> if one of your customers happens to be running a virus scan or some
>>other
>> heavy job at the same time, you might find it exceeds 60 seconds anyway.
>>
>> Workers or Pseudo-threading [1] might help you.  Also having the server
>>do
>> the processing and send you the results.
>>
>> -Alex
>>
>> [1] http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html
>>
>> On 6/25/15, 6:52 AM, "mark goldin" <ma...@gmail.com> wrote:
>>
>> >I have a large xml data that UI needs to process. I am getting the
>>above
>> >message about timing out. Not sure I can break my function into smaller
>> >pieces. Any other idea?
>> >
>> >Thanks
>>
>>


Re: A script has executed for longer than ....

Posted by mark goldin <ma...@gmail.com>.
What if I break xml into pieces for separate processing and then put them
together into one final xml?

On Thu, Jun 25, 2015 at 9:12 AM Alex Harui <ah...@adobe.com> wrote:

> Well, xml is terribly slow.  If you can server-side process it into
> something else (RemoteObject/AMF to ValueObjects is considered to be the
> fastest, ObjectProxy is also slow, JSON might be fast) then you might be
> able to process all of the data in 60 seconds in ActionScript.  However,
> if one of your customers happens to be running a virus scan or some other
> heavy job at the same time, you might find it exceeds 60 seconds anyway.
>
> Workers or Pseudo-threading [1] might help you.  Also having the server do
> the processing and send you the results.
>
> -Alex
>
> [1] http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html
>
> On 6/25/15, 6:52 AM, "mark goldin" <ma...@gmail.com> wrote:
>
> >I have a large xml data that UI needs to process. I am getting the above
> >message about timing out. Not sure I can break my function into smaller
> >pieces. Any other idea?
> >
> >Thanks
>
>

Re: A script has executed for longer than ....

Posted by Alex Harui <ah...@adobe.com>.
Well, xml is terribly slow.  If you can server-side process it into
something else (RemoteObject/AMF to ValueObjects is considered to be the
fastest, ObjectProxy is also slow, JSON might be fast) then you might be
able to process all of the data in 60 seconds in ActionScript.  However,
if one of your customers happens to be running a virus scan or some other
heavy job at the same time, you might find it exceeds 60 seconds anyway.

Workers or Pseudo-threading [1] might help you.  Also having the server do
the processing and send you the results.

-Alex

[1] http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html

On 6/25/15, 6:52 AM, "mark goldin" <ma...@gmail.com> wrote:

>I have a large xml data that UI needs to process. I am getting the above
>message about timing out. Not sure I can break my function into smaller
>pieces. Any other idea?
>
>Thanks