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: Using Pipes with a different approach - Clarification  (Read 9302 times)
cgm
Newbie
*
Posts: 5


View Profile Email
« on: July 03, 2009, 06:09:20 »

Hello ,
I have been currently working on an application using the multicore where  pipes is used to handle data transactions between my modules. the simple examples mainly use a shell and module and communication is usually from shell to module and back module to shell...

Trying to do something more .. i have a module which by itself is a shell to other modules that it loads and handle separately  ... and at the same time i want to give some modules to talk to each other apart from the shell..

To do so i created a new junctionmediator  at the module [which is a shell for other modules now] and gave it all handling of communiction with its children modules..  well now i have 2 junctionmediator registered for a module .. and in case i need to add communication between modules i should add a 3rd junctionmediator .. i think i m doing something wrong or understood something not quite well any clarification would be helpful  ..
is the latter correct or it will cause problems ??
i m still working on this so probably it works...  :-\

- And does anyone have an example of using pipe using a different approach other than shellToModule , moduleToshell ... in slideshow for multicore and pipes on puremvc tv a diagrams was shown with different pipe connections .. is there an example on those ..

Thanks in advance  for any  help you can provide ..  :)
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: July 03, 2009, 04:00:47 »

You only need one JunctionMediator per Core. It doesn't matter how many other Cores it talks to, the JunctionMediator can have as many pipes as you need. Of course they need to have unique names.

-=Cliff>
Logged
Tekool
Sr. Member
****
Posts: 192


View Profile WWW Email
« Reply #2 on: July 04, 2009, 04:21:23 »

does anyone have an example of using pipe using a different approach other than shellToModule , moduleToshell ...

If you want a different approach to handle module to module communication, you can check mine : http://www.tekool.net/blog/2009/06/14/puremvc_flex_modules_and_pipes/
Logged
cgm
Newbie
*
Posts: 5


View Profile Email
« Reply #3 on: July 04, 2009, 08:51:34 »

thx for the reply cliff and trek ..
i am looking into your example trek .. thx...

in case i have a shell where i registered a teeMerge and teeSplit for 2 pipes and in and out pipe as such :
:
junction.registerPipe( PipeAwareModuleConstants.SHELL_TO_MODULE_PIPE,Junction.OUTPUT, new TeeSplit() );
junction.registerPipe( PipeAwareModuleConstants.MODULE_TO_SHELL_PIPE,Junction.INPUT,new TeeMerge() );

and i do the relative connection to modules and thats working well.

But i have  a module[Z] which have its own teeMerge and teeSplit .. :
:
junction.registerPipe( PipeAwareModuleConstants.CORE_TO_MODULE_PIPE,Junction.OUTPUT,new TeeSplit() );
junction.registerPipe( PipeAwareModuleConstants.MODULE_TO_CORE_PIPE,Junction.INPUT,new TeeMerge() );

To connect this module[Z] to the shell i am overriding its ACCEPT_INPUT_PIPE and ACCEPT_OUTPUT_PIPE  :
:
case JunctionMediator.ACCEPT_INPUT_PIPE:
var inputPipe:IPipeFitting = note.getBody() as IPipeFitting;
var coreInFitting: TeeMerge = junction.retrievePipe( PipeAwareModuleConstants.MODULE_TO_CORE_PIPE ) as TeeMerge;
coreInFitting.connectInput( inputPipe );
break;
case JunctionMediator.ACCEPT_OUTPUT_PIPE:
var outputPipe:IPipeFitting = note.getBody() as IPipeFitting;
var coreOutFitting: TeeSplit = junction.retrievePipe( PipeAwareModuleConstants.CORE_TO_MODULE_PIPE ) as TeeSplit;
coreOutFitting.connect( outputPipe );


So far is the latter correct ? ...
when i am sending a message from : shell To module[Z] - message is received.
nevertheless when i send a message from :  module[Z] To Shell - No message is received.

same if this module[Z] send a message to its children modules the children receives the message
( module[Z] To a module connected to module[Z] only - message received )
but when the children try to send to module[Z] no message received ...

No errors popup when i debug ..
Logged
cgm
Newbie
*
Posts: 5


View Profile Email
« Reply #4 on: July 06, 2009, 05:52:12 »

I solved the latter problem i had .. the connections are correct , my problem was in sending the messages .

when i send a message from :  module[Z] To Shell - No message is received.
problem here i was using the wrong pipe to send the messages ..  was using the MODULE_TO_SHELL_PIPE whereas i should have used : CORE_TO_MODULE_PIPE ...

when the children try to send to module[Z] no message received ...
i tried sending onRegister and that didnt work apparently since no accept inputs and outputs was made yet.

Logged
Tekool
Sr. Member
****
Posts: 192


View Profile WWW Email
« Reply #5 on: July 06, 2009, 08:12:45 »

I'm glad that you could find a solution to all of your problems, I had expected to answer you in the evening, but only with little time.

Good luck with pipes. ;)
Logged
Pages: [1]
Print