Jump to content

Actor Framework: Difference between revisions

From LabVIEW Wiki
Line 44: Line 44:
** [https://www.youtube.com/watch?v=uUopETUSAJw&list=PLmF-6jvwRvVNFzBjzh4bQDjFbv6lShcth&index=11 "11. Using Subpanels with the LabVIEW Actor Framework"]
** [https://www.youtube.com/watch?v=uUopETUSAJw&list=PLmF-6jvwRvVNFzBjzh4bQDjFbv6lShcth&index=11 "11. Using Subpanels with the LabVIEW Actor Framework"]
** [https://www.youtube.com/watch?v=wnyG-59U6pw&list=PLmF-6jvwRvVNFzBjzh4bQDjFbv6lShcth&index=12 "12. LabVIEW Maps (feat. Actor Framework)"]
** [https://www.youtube.com/watch?v=wnyG-59U6pw&list=PLmF-6jvwRvVNFzBjzh4bQDjFbv6lShcth&index=12 "12. LabVIEW Maps (feat. Actor Framework)"]
** [https://www.youtube.com/watch?v=oYUow2c-nCE&list=PLmF-6jvwRvVNFzBjzh4bQDjFbv6lShcth&index=13 "Interface Messages in Actor Framework - Never create an Abstract Message again!"]
** New for LabVIEW 2020! [https://www.youtube.com/watch?v=oYUow2c-nCE&list=PLmF-6jvwRvVNFzBjzh4bQDjFbv6lShcth&index=13 "Interface Messages in Actor Framework - Never create an Abstract Message again!"]
** [https://www.youtube.com/watch?v=48oaT4r90oE&list=PLmF-6jvwRvVNFzBjzh4bQDjFbv6lShcth&index=14 "Trying out Actor Framework in LabVIEW NXG 4.0..."]
**New in LabVIEW NXG (> 4.0)[https://www.youtube.com/watch?v=48oaT4r90oE&list=PLmF-6jvwRvVNFzBjzh4bQDjFbv6lShcth&index=14 "Trying out Actor Framework in LabVIEW NXG 4.0..."]
*Actor Framework Basics by [https://www.linkedin.com/in/derek-trepanier/ Derek E. Trepanier], Moore Good Ideas
*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-1/ "Actor Framework Basics: Part 1 - the Basics"]

Revision as of 10:22, 25 September 2020

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