Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: [ FIXED ] MacroCommand.execute() does not execute subCommands in FIFO order  (Read 9605 times)
chphilli
Newbie
*
Posts: 7


View Profile Email
« on: September 17, 2009, 12:26:39 »

The MacroCommand.execute() method does not execute it's subCommands in FIFO order. Instead it executes them in LIFO order, due to the self.subCommands.pop() call. According to Python's documentation:

>>> help(list.pop)
Help on method_descriptor:

pop(...)
    L.pop([index]) -> item -- remove and return item at index (default last)

Changing the .pop() to .pop(0) causes the commands to be removed from the front of the list, providing FIFO ordering.

----

As a side question, I ran into this bug fairly early (In fact, I was writing a StartupCommand for my new application) -- how is it that other people haven't run into this problem?
« Last Edit: September 22, 2009, 11:34:48 by puremvc » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: September 17, 2009, 01:39:52 »

Good catch!

I personally don't use PHP or I'm sure I would've noticed this. I suspect that no one ever set up commands whose order actually mattered. Although the standard procedure is to prep the model before the view, if none of the view preparations lead immediately to requests for proxies that should've been registered already, you'd not notice the difference.

-=Cliff>
Logged
chphilli
Newbie
*
Posts: 7


View Profile Email
« Reply #2 on: September 17, 2009, 04:41:31 »

Hi Cliff --

Thanks for the response -- just FYI, this is for the Python port, not the PHP port.

Is there anything more I should do to get this fixed?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: September 18, 2009, 07:05:47 »

Sorry about that. Yes, email Toby, and point him to this thread just in case he hasn't seen it yet. You'll find a link to his profile and email on the Python port page.

Thanks
-=Cliff>
Logged
tobydeh
Moderator
Sr. Member
*****
Posts: 52


View Profile Email
« Reply #4 on: September 21, 2009, 04:10:12 »

Hi Chris,

Sorry for the delay getting back to you...

Well spotted, I'll commit this change to the repository asap.

Toby.
Logged
Pages: [1]
Print