Jump to content

Actor Framework: Difference between revisions

From LabVIEW Wiki
m Reorganized links
Line 29: Line 29:


More to come on when and why one might want to override these methods.
More to come on when and why one might want to override these methods.
== Articles ==
* [http://www.mooregoodideas.com/actor-framework/basics/AF-basics-part-1/ Actor Framework Basics: Part 1 - the Basics]
* [http://www.mooregoodideas.com/actor-framework/basics/AF-basics-part-2/ Actor Framework Basics: Part 2 - the Actor]
* [http://www.mooregoodideas.com/actor-framework/basics/AF-basics-part-3/ Actor Framework Basics: Part 3 - Launching and Communicating]
* [http://www.mooregoodideas.com/actor-framework/basics/AF-basics-part-4/ Actor Framework Basics: Part 4 - Being Productive With Actors]
* [http://www.mooregoodideas.com/actor-framework/basics/AF-basics-walkthrough/ Actor Framework Basics: Walkthrough - Creating a Logger Actor]
-- by [https://www.linkedin.com/in/derek-trepanier/ Derek E. Trepanier], Moore Good Ideas
''Actors are a powerful tool when creating large, highly parallelized, scalable systems in LabVIEW, but the framework takes some effort to conceptualize and therefore takes some time to learn. This series of articles will walk you through all of the major concepts in the Actor Framework world and get you to a point where you can start building and using Actor Framework applications.''
[http://www.labviewcraftsmen.com/blog/fun-with-the-actor-framework-pubsub Fun with the Actor Framework: PUB/SUB] - by [https://www.linkedin.com/in/jon-mcbee/ Jon McBee], LabVIEW Craftsmen Blog
''Communication between Actors is meant to be done by traversing the Actor tree.  Assuming we decide not to pass message enqueuers around to all Actors in the tree, we will end up with a lot of message classes and a lot of message routing.  The extra messages and routing, however, buys us robustness as Actor E has no way of knowing if Actor C currently exists.  But what if we could bypass the tree for certain types of messages in a way that allowed us to decouple our actors from each other...''
"[[Convert Queued Message Handler (QMH) to Actor Framework (AF)|Actor Framework is not as hard as you think and here is why…]]" - by Quentin "Q" Alldredge, Q Software Innovations, LLC
''If you are familiar with the Queued Message Handler (QMH) Design Pattern and Object-Oriented Programming (OOP) then you already know everything you need to start with Actor Framework.  The purpose of this article is to show the parts of the Actor Framework that are comparable to the QMH Design Pattern and provide a step-by-step procedure for converting a QMH project to an Actor Framework project.''


== External Links  ==
== External Links  ==
*Actor Framework Basics by [https://www.linkedin.com/in/derek-trepanier/ Derek E. Trepanier], Moore Good Ideas
** [http://www.mooregoodideas.com/actor-framework/basics/AF-basics-part-1/ "Actor Framework Basics: Part 1 - the Basics"]
** [http://www.mooregoodideas.com/actor-framework/basics/AF-basics-part-2/ "Actor Framework Basics: Part 2 - the Actor"]
** [http://www.mooregoodideas.com/actor-framework/basics/AF-basics-part-3/ "Actor Framework Basics: Part 3 - Launching and Communicating"]
** [http://www.mooregoodideas.com/actor-framework/basics/AF-basics-part-4/ "Actor Framework Basics: Part 4 - Being Productive With Actors"]
** [http://www.mooregoodideas.com/actor-framework/basics/AF-basics-walkthrough/ "Actor Framework Basics: Walkthrough - Creating a Logger Actor"]
*[http://forums.ni.com/t5/Labvolution/LabVIEW-Actor-Framework-Basics/ba-p/3476654 "Actor Framework Basics"] by Greg Payne, Labvolution.
*[http://www.labviewcraftsmen.com/blog/fun-with-the-actor-framework-pubsub "Fun with the Actor Framework: PUB/SUB"] by [https://www.linkedin.com/in/jon-mcbee/ Jon McBee], LabVIEW Craftsmen Blog
*[[Convert Queued Message Handler (QMH) to Actor Framework (AF)|"Actor Framework is not as hard as you think and here is why…"]] by Quentin "Q" Alldredge, Q Software Innovations, LLC
*[https://forums.ni.com/t5/Actor-Framework/ct-p/7001 NI Community].
*[https://forums.ni.com/t5/Actor-Framework/ct-p/7001 NI Community].
*[https://forums.ni.com/t5/Actor-Framework-Documents/READ-THIS-FIRST-to-get-started-with-Actor-Framework/ta-p/3493762 NI Introduction].
*[https://forums.ni.com/t5/Actor-Framework-Documents/READ-THIS-FIRST-to-get-started-with-Actor-Framework/ta-p/3493762 NI Introduction].
*[http://forums.ni.com/t5/Labvolution/LabVIEW-Actor-Framework-Basics/ba-p/3476654 "Actor Framework Basics"] by Greg Payne, Labvolution.


[[Category:Actor Framework]]
[[Category:Actor Framework]]
[[Category:Frameworks]]
[[Category:Frameworks]]

Revision as of 13:02, 23 April 2019

The Actor Framework is an Actor Model implementation that has been distributed with LabVIEW since LabVIEW 2012.

Introduction

The Actor Framework introduces two main classes:

  1. The Actor class
  2. 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.

Actor Framework message communication (from Jon McBee's article " FUN WITH THE ACTOR FRAMEWORK: PUB/SUB")

The Message Class

A basic Message Class contains only two methods:

  1. Do.vi - calls the method that contains the code that is the action for the Actor to execute
  2. 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.

External Links