Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

AF 101: Let's spawn some actors programmatically

I think the best way to master AF is to do simple step one at time.

In the zip file I did a project with:

Launcher.vi --> start "controller" actor

then controller actor starts "GUI" actor in his actor core, and shows his front panel.

GUI buttonSpawnTask will programmatically spawn "Task" actor (and I guess they are added to the Controller's child actors collection) and show their front panel.

 

When I click Exit button, I send a stop msg to controller that will stop all childs by default.

It works with GUI actor, GUI is closed.

Tasks are not closed. Why?

 

How can I see the Nested actor array content?

 

 

 

0 Kudos
Message 1 of 4
(2,739 Views)
0 Kudos
Message 2 of 4
(2,735 Views)

How can I see the Nested actor array content?

 

 



I don't have the monitored actor installed, so I couldn't look at your code, but in answer to your last question, you can't.  If you want to  keep track of your nested actors, you need to grab the enqueuer when you launch them and store the enqueuer in your actor private data. 

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
0 Kudos
Message 3 of 4
(2,722 Views)

thanks, so I launch a nested actor and the AF adds its enqueuer to the caller's [nested actors] collection (array), so that it is possibile to "auto-shutdown" the hierarchy once the root gets the stop msg.

But if I don't "store" those enqueuers I don't have any chance to message those spawned actors.

 

I zipped the sources without the MGI monitored actor plugin. (it's very usefull btw)

My error was that I was not properly exit the helper loop (I used a variable, then switched to user event.... I saw the solution with variable somewhere btw)

 

0 Kudos
Message 4 of 4
(2,701 Views)