Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Protected-scope Messages in Actor Framework

Solved!
Go to solution

Has anyone come up with a way of creating private messages that can only be sent (with Send my_method.vi) from within VIs of an Actor descendant? The main application would be for creating messages that could only be sent from parallel loops inside an actor's Actor Core.vi to the parent method so that the main actor loop can process the message. For instance, if you only want parallel processes inside the override of Actor Core.vi to be sending their error info back to the loop in the parent method, using a private-scoped message could keep any other VI exterior to the class from accidentally sending error info to the actor.

0 Kudos
Message 1 of 3
(3,646 Views)
Solution
Accepted by topic author cgiustini1

Yes.

1) Put the parent actor and its message in a library and then mark the message class as private in the library. This creates a message that only the parent actor can send.

2) Add a "send this message.vi" to the parent class. Make it protected. Have that VI generate and send the private message.

0 Kudos
Message 2 of 3
(2,939 Views)

Cool. Next time I need to do this, I will give it a shot.

0 Kudos
Message 3 of 3
(2,939 Views)