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] 2
Print
Author Topic: PipeWorks- a PureMVC AS3 MultiCore Demo  (Read 36292 times)
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« on: May 31, 2008, 09:51:36 »

This demo illustrates simple usage of the PureMVC AS3 MultiCore Framework using Flex Modules.

The demo has historically been located here: http://trac.puremvc.org/Demo_AS3_MultiCore_Flex_PipeWorks
The project has been moved here: https://github.com/PureMVC/puremvc-as3-demo-flex-pipeworks/wiki

The author is Cliff Hall.
« Last Edit: September 23, 2012, 04:38:58 by puremvc » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: May 31, 2008, 10:01:03 »

Hi Folks,

This demo currently has a little bug that crept in with some refactoring done late last night. Messages from the PrattlerModule are currently being doubled in the log. But the messages from the shell are only sent once.

This isn't a pipes utility problem, it's been working fine and in fact the utility has a full set of unit tests of its own. Just some little niggly thing in the demo, I'll get worked out shortly. But I wanted to get this out there as there are a lot of people looking at Pipes and wondering what to do with it...

-=Cliff>
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: May 31, 2008, 11:51:26 »

Alright, no problem. Took longer to republish than to fix. Version 1.1 is now available and working as advertised.

Soon I will post more on the theory of operation, but see the release notes page for highlights before diving into the code.

-=Cliff>
Logged
swidnikk
Courseware Beta
Jr. Member
***
Posts: 13


View Profile Email
« Reply #3 on: June 01, 2008, 07:22:33 »

This is an excellent demo. I found a small bug:

Class: org.puremvc.as3.multicore.demos.flex.pipeworks.shell.view.ShellJunctionMediator

When handling the switch case ApplicationFacade.CONNECT_MODULE_TO_SHELL of handleNotification funciton, this line

:
var shellOut:IPipeFitting = junction.retrievePipe(JunctionMediator.STDIN) as IPipeFitting;
should be

:
var shellOut:IPipeFitting = junction.retrievePipe(JunctionMediator.STDOUT) as IPipeFitting;



« Last Edit: June 01, 2008, 07:24:37 by swidnikk » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #4 on: June 01, 2008, 05:12:23 »

Good eye there, swidnikk!

The only reason this didn't choke is that the Shell never talks to the Prattler module. If you note, the PrattlerJunctionMediator's handlePipeMessage method is currently not doing anything. The PrattlerModule sends its FeedWindow on its STDSHELL output pipe to the Shell when it is created.

-=Cliff>
Logged
swidnikk
Courseware Beta
Jr. Member
***
Posts: 13


View Profile Email
« Reply #5 on: June 02, 2008, 11:34:17 »

Thanks :)

I must say that the pipes utility is damn cool. I ported some of the ideas from your demo to my application and everyone on my team is very happy with it. We had a few meetings to discuss the pipe messages each core handles and now we're happily on our way implementing again. What I really like is the flexibility and freedom this utility gives. It also helps to fight feature/code bloat. Instead of piling up functionality in a single project, we have several smaller ones that are dedicated to a specific task. We currently have 5 cores including the shell.

While I did go ahead and create a teesplit pipe from the shell to all cores so that general messages can be broadcast, I found it useful to have a dedicated pipe from the shell to each core. Each core has only a STDSHELL pipe for outbound communication so, the shell's junction mediator performs all the message switching.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #6 on: June 04, 2008, 10:15:26 »

Hi Folks,

Please note, the PipeWorks demo has changed and so has the Pipes Utility. The IPipeAware interface and JunctionMediator have been refactored into the utility itself.

-=Cliff>
Logged
bobster
Newbie
*
Posts: 1


View Profile Email
« Reply #7 on: July 09, 2008, 12:11:16 »

Hi...Just getting started with Flex and PureMVS. THis looks like a great demo. Im having a small problem maybe you can point me in the right direction. Ive added both the pipeworks folder and the Muticore swcs' to the library path, but I get 2 compile errors below on the Facade. Line 30. I thought it would be the library, but its there. Any ideas? Thanks Bob
       
private var facade:ApplicationFacade = ApplicationFacade.getInstance(NAME);

Severity and Description   Path   Resource   Location   Creation Time   Id
1046: Type was not found or was not a compile-time constant: ApplicationFacade.   Pipeworks/src   Pipeworks.mxml   line 30   1215628662177   29
Severity and Description   Path   Resource   Location   Creation Time   Id
1120: Access of undefined property ApplicationFacade.   Pipeworks/src   Pipeworks.mxml   line 30   1215628662177   30



Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #8 on: July 11, 2008, 08:43:38 »

Is the src folder the folder in the build path, or is it the PipeWorks project folder? It should be the src folder.
-=Cliff>
Logged
ramanuja
Jr. Member
**
Posts: 17


View Profile Email
« Reply #9 on: July 12, 2008, 01:23:50 »

Hi Cliff,

I saw the Modularity demo that you have authored. It is very impressive. [http://svn.puremvc.org/Demo_AS3_MultiCore_Flex_Modularity/]

If the application is a very complex one, the app size (swf) will become extremely huge even though it is modular right? What are the ways to alleviate this problem?

Is it not a good idea to generate multiple swf's, one swf per module and load them when required realtime? :-\
I got this idea from http://www.websector.de/blog/2008/06/21/a-basic-puremvc-multicore-as3-example-using-pipes-utility-and-modules/

I am keenly waiting to receive your valuable inputs on this.

Thank you.
« Last Edit: July 12, 2008, 01:26:37 by ramanuja » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #10 on: July 12, 2008, 04:41:06 »

Yes of course, you want the modules to be compiled and loaded in almost any case, but that was beyond the scope of the demos which were focusing on the collaborations between modules.

Soon I will introduce a loader utility.

-=Cliff>
Logged
ramanuja
Jr. Member
**
Posts: 17


View Profile Email
« Reply #11 on: July 17, 2008, 01:25:52 »

Hi Cliff,

I have a doubt with the PipeWorks demo.

In "PrattlerModule.as", you are getting an instance of the ApplicationFacade with the key as "moduleID" which is an incrementing key.

So each time I click on the "New Prattler" button, a new ApplicationFacade  is instantiated with a unique moduleID. Now, when I close a prattler window, the mediators are being removed. What about the facade? Is it not a good idea to remove the facade as well since I feel this is a memory leak? Am I correct?   :-\

Regards,
Ramanuja
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #12 on: July 17, 2008, 01:55:50 »

Yes, and the module should be disconnected from the logger and shell pipes as well. A facade.removeCore(key) is what's needed once all references in the main app have been removed.

I'll make these changes to the demo as soon as possible.

-=Cliff>
Logged
ramanuja
Jr. Member
**
Posts: 17


View Profile Email
« Reply #13 on: July 17, 2008, 02:07:54 »

Cliff,

Thanks for the quick response  :)

Regards,
Ramanuja
Logged
lowpitch
Jr. Member
**
Posts: 10


View Profile Email
« Reply #14 on: August 15, 2008, 08:30:08 »

ello,

I'm currently writing up a Pipes tutorial to force myself to understand it. I've found that writing about something makes me understand it far more than simply skimming over some docs etc.

Anyway, I'm wondering if there are any resources anywhere talking more about Queues and Filters. The only info I've found so far is within the source code of the Pipes demo. Anyone know if there's any more information floating around about either of them?

Cheers,
toby
Logged
Pages: [1] 2
Print