The Actor Framework is an Actor Model implementation that has been distributed with LabVIEW since LabVIEW 2012.
- To learn more about the Actor Model click here for the Wikikpedia article.
- To learn about other community created Actor implementations see the"Other Actor Implementation Designs" section on the Actor Oriented Design Patterns page.
The Actor Framework introduces two main classes:
- The Actor class
- The Message class
The basic Actor only does something only when it receives a message telling it to do something. What it is supposed to do is tied to the message that was sent. It can either execute something and be done until the next message, it can launch other Actors, or it can send more messages. In the Actor Framework it is limited to sending messages to itself, to the Actor that launched it (if it is not the root Actor), or to Actors it launched.
The Message Class
A basic Message Class contains only two methods:
- Do.vi - calls the method that contains the code that is the action for the Actor to execute
- Send [Name of Message].vi - requires the enqueuer (address) of the Actor to send the message to, which causes the message to be sent to that Actor
The Actor Class
A basic Actor only needs to contain the methods that the messages call. However, there are some optional overrides that can extend the functionality of the Actor. They include:
- Actor Core.vi
- Handle Error.vi
- Handle Last Ack Core.vi
- Pre Launch Init.vi
- Receive Message.vi
- Stop Core.vi
- Substitute Actor.vi
More to come on when and why one might want to override these methods.
- Actor Framework Basics by Derek E. Trepanier, Moore Good Ideas
- "Actor Framework Basics" by Greg Payne, Labvolution.
- "Fun with the Actor Framework: PUB/SUB" by Jon McBee, LabVIEW Craftsmen Blog
- "Actor Framework is not as hard as you think and here is why…" by Quentin "Q" Alldredge, Q Software Innovations, LLC
- NI Community.
- NI Introduction.