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

Show Posts

* | |

  Show Posts
Pages: [1]
1  PureMVC Manifold / Demos and Utils / Re: StateMachine - A PureMVC Haxe Utility on: June 05, 2009, 08:24:04
Cheers, I'll let him know.
2  PureMVC Manifold / Demos and Utils / Re: StateMachine - A PureMVC Haxe Utility on: June 04, 2009, 08:52:09
Hi,

I've run into a small problem, when entering a state I want to have the ability to change to a new state, but because the "currentState" hasn't been set we're left in a weird state of having no state at all.

StateMachine.hx

// Enter the next State
if( nextState.entering != null ) sendNotification( nextState.entering, nextState );
currentState = nextState;

I would like to change it to:

// Enter the next State
currentState = nextState;
if( nextState.entering != null ) sendNotification( nextState.entering, nextState );


This will fix the issue I'm seeing. Note I'm using this in neko and this could be only present in this.

thoughts?
3  PureMVC Manifold / Bug Report / Re: [DEFUSED] Notifier.facade & Junction.removePipe() doesn't disconnect! on: April 07, 2009, 08:33:23
Yes agreed, it is down to events happening after the fact. I've created a way to notify my self if this happens and trace an alert whilst in debug mode of the build.

I agree, this isn't a bug now that it's explained, but it's a gotcha that I didn't expect to see.

Thanks for your help
simon
4  PureMVC Manifold / Bug Report / Re: [DEFUSED] Notifier.facade & Junction.removePipe() doesn't disconnect! on: April 07, 2009, 01:14:21
Hi Cliff,

I think I'm talking about the fine details of how it disconnects and removes the module. I'm using the Facade.removeCore in it's static way like you've shown. The issue I'm having is actually a problem with the Notifier where the pipe would still be connected in some strange way so that it would reload the Facade, but not the actual ModuleFacade the main Facade.

:
protected function get facade():IFacade
{
    if ( multitonKey == null ) throw Error( MULTITON_MSG );
    return Facade.getInstance( multitonKey );
}

If multitonKey is not removed in the removeCore, or after that then this can be still called. This means walking through all Commands, Views and Models to make sure that happens. It might just be the way I'm removing, but essentially I remove commands, mediators, models and then the core at a similar time the external application launches another module. This connects the pipe and that module sends a message, the application calls back and this would some how call this notifier, which in turn reboots the Facade. This wouldn't be bad, but I set up my commands in a initialisation method, which won't get called again because the mulition key has already been set for the Facade and not for the ModuleFacade...

Hope this helps

5  PureMVC Manifold / Bug Report / [DEFUSED] Notifier.facade & Junction.removePipe() doesn't disconnect! on: April 06, 2009, 06:23:33
Hi, I'm not sure where to report this bug?

I've got the multicore version up and working and have several cores all interacting using the Pipes interaction. The issue is when disconnecting the pipes and I send a message through Pipes. The core I removed gets rebooted because of the Notifier get facade. So there is two main bugs,
  • removeCore doesn't stop the Notifier get facade from rebooting the Facade
  • removePipe doesn't disconnect the Pipe

The first issue; I had assumed that multitonKey would be set to null when you remove a core, so walking down the tree and nulling multitonKey. This should and would prevent any possibility of the core being used again. I've edited my version to do this, so it cleans up after itself.

The second issue; just removing the IPipeFitting from the pipesMap isn't enough, you have to disconnect the pipe. I don't want to have to disconnect the pipes manually as I would have to store a reference to that and that's just duplicating code unnecessary. So I've edited the removePipe to the following --->

:
public function removePipe( name:String ):void
{
        if ( hasPipe(name) )
        {
                var type:String = pipeTypesMap[name];
                var pipesList:Array;
                switch (type) {
                        case INPUT:
                                pipesList = inputPipes;
                                break;                                         
                        case OUTPUT:
                                pipesList = outputPipes;       
                                break;                                 
                }
                var pipe : IPipeFitting;
                for (var i:int=pipesList.length-1;i>=0;--i){
                        if (pipesList[i] == name){
                                pipe = pipesMap[name] as IPipeFitting;
                                pipe.disconnect();

                                pipesList.splice(i, 1);
                        }
                }
                delete pipesMap[name];
                delete pipeTypesMap[name];
        }
}

This has solved my problem and cleaned up any cores that are hanging on!
Pages: [1]