Announcement Announcement Module
Collapse
No announcement yet.
How can understand, what at performance OperationQueue there was an error? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can understand, what at performance OperationQueue there was an error?

    Hi,

    I'm using Spring-Actionscript 1.0RC1. I like OperationQueue, but my errorHandler is not called.

    I use not correct MODULE_URL (for my testing errorHandler):
    Code:
    var queue:OperationQueue = new OperationQueue();
    queue.addErrorListener(queue_errorHandler);
    queue.addCompleteListener(queue_completeHandler);
    queue.addOperation(new LoadModuleOperation(MODULE_URL));
    queue.addOperation(new LoadModuleOperation(MODULE_URL));
    But caused queue_completeHandler (!).
    I looked at the code OperationQueue.

    Method (129 line) operation_errorHandler(event:OperationEvent) exactly the same as operation_completeHandler(event:OperationEvent).

    I asked myself: WTF?!)

    tell me please, how do I implement this functionality?

  • #2
    wrong eventlistener

    Hi there,

    right now the OperationQueue is still quite 'stupid', it only executes the operations one after the other, it has no option to fail on error and it doesn't redispatch the error events of its operations.
    This will likely change in the future but for now, to handle the errors of your loadmodule operations you'll have to add the event handlers to the separate LoadModuleOperation instances. i.e.:

    Code:
    var queue:OperationQueue = new OperationQueue();
    queue.addCompleteListener(queue_completeHandler);
    var lmo:LoadModuleOperation = new LoadModuleOperation(MODULE_URL);
    lmo.addErrorListener(queue_errorHandler);
    queue.addOperation(lmo);
    lmo = new LoadModuleOperation(MODULE_URL2);
    lmo.addErrorListener(queue_errorHandler);
    queue.addOperation(lmo);
    Hope that helps,

    cheers,

    Roland

    Comment


    • #3
      Yes, I can add failure event handlers on the operations (on LoadModuleOperation), but I need OperationQueue doesn't invoke queue_completeHandler in case of error. I like feature to add some operations and feature to know when they performed, but I don't want to get success report when error really was happen.

      if you know how rapidly implement it can you tell me it ....

      PS if you to use FlexUnit, here is my test:
      Code:
      public class OperationQueueTest extends TestCase{
      
         private var MODULE_URL:String = "blablabla";
      
         public function test01():void {
            var queue:OperationQueue = new OperationQueue();
            //queue.addErrorListener(queue_errorHandler);
            queue.addCompleteListener(queue_completeHandler);
            queue.addOperation(new LoadModuleOperation(MODULE_URL));
            queue.addOperation(new LoadModuleOperation(MODULE_URL));
         }
      
         function queue_completeHandler(event:OperationEvent):void {
            fail("");
         }
      }
      regards,
      Tatiana
      Last edited by tflyagina; Apr 1st, 2010, 06:32 AM.

      Comment

      Working...
      X