Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Proposing a change to Launch Actor.vi: No more required caller input?

One other option, BTW, is to have a separate "Lanch Independant Actor" method in addition to the regular "Launch Actor".

I like this idea, and to go further on this line of thought, the "Lanch Independant Actor" could be named like "Launch Basic Actor" or so and be a SubVI of the "Launch Actor". The "Launch Actor" would stay as it is to be really backwards compatible, but in the inside only the run-time check would stay, all the other functionality would be in the new SubVI ("Launch Basic Actor"), which has the "Actor-to-Caller Enqueuer" set to recommended.

The name of this SubVI should be chosen very wisely, it really has to show that this implementation is what functionally needed. The "Launch Actor" is only a design recommendation using this core SubVI.

Launch Actor:

tst_Launch Actor.png

SubVI:

tst_Launch Basic Actor.png

0 Kudos
Message 11 of 54
(1,667 Views)

My initial gut reaction is "create a second VI which doesn't have the input", because that makes it safer (i.e. if people do drop the old VI, then they have the required input), but that makes the API not as clean, so I think I would go with option 2 (set as recommended).

And yes, I do agree with others that the addition of the unnecessary caller enqueuer code to the launch can be confusing and distracting.

Also, I would suggest renaming the output of the launch VI from "Caller-To-Actor Enqueuer" to just "Actor's Enqueuer" or something similar, as the enqueuer isn't limited to the caller and the terminology is cumbersome. I understand that this was chosen after debates (at least I think I remember debates) and that you want to maintain symmetry, but I think it makes it easier to understand. If you still want the symmetry, you might consider renaming the input to "Caller's Enqueuer".


___________________
Try to take over the world!
0 Kudos
Message 12 of 54
(1,667 Views)

tst wrote:

Also, I would suggest renaming the output of the launch VI from "Caller-To-Actor Enqueuer" to just "Actor's Enqueuer" or something similar...

If we were chosing names from scratch I would suggest "Actor's address" and "Caller's address". 

0 Kudos
Message 13 of 54
(1,667 Views)

drjdpowell wrote:

tst wrote:

Also, I would suggest renaming the output of the launch VI from "Caller-To-Actor Enqueuer" to just "Actor's Enqueuer" or something similar...

If we were chosing names from scratch I would suggest "Actor's address" and "Caller's address". 

Borrowing precedence from Akka, this could be called a "Mailbox". This generalization allows concrete implementations suited to your domain -- perhaps a Queue, perhaps a PriorityQueue, perhaps a Network Stream, perhaps a URI endpoint...

And to the original question, I agree with sentiments for removing the requirement of passing the "owner's" mailbox to the launched actor. One legit circumstance is a shell launcher (e.g., splash screen), of ephemeral lifetime, that kicks off a star-pattern of top-level actors and then itself buggers out -- there would be no need for those TLA's to have retained a reference to the launcher's Mailbox.

0 Kudos
Message 14 of 54
(1,667 Views)

drjdpowell wrote:


If we were chosing names from scratch I would suggest "Actor's address" and "Caller's address". 

I know that the actor model uses "address", but I think the term would be confusing to most people. I would just use "queue", since the AF only has one for each actor, but I understand the term "enqueuer" was chosen to make it explicit. Alternatively, I would use something like "mail box" or "inbox", that makes it clearer that this is something which is receiving messages, as opposed to "address", which is fairly generic.


___________________
Try to take over the world!
0 Kudos
Message 15 of 54
(1,667 Views)

(test post -- are my responses moderated/delayed?) ***EDIT: Perhaps a glitch or user error "ate" my last message. Oh well, here's a new recap below***

I like the generalization Mailbox also, which allows different concrete implementations of Messengers. (Akka, a popular actor-oriented framework, likewise uses Mailbox to describe incoming messages to an actor. Though, the semantics are different from AF, since Akka actors accept/process requests, whereas AF messages accept/process commands, so "Enqueuer" might actually be the more appropriate term for AF)

Also, to the original topic, I like the idea of removing the requirement of passing the spawner's Enqueuer to the spawned actor. One legit circumstance is the ephemeral Launcher e.g., a splash screen, which lazy loads and launches the top-level actors connecting them in a star pattern, then itself buggers out once all top-level actors are healthy and running.

Message was edited by: JackDunaway

***EDIT: hours later, looks like the original post was moderator-approved; sorry for the noise here!

0 Kudos
Message 16 of 54
(1,667 Views)

Option 2, for the reasons listed above.

0 Kudos
Message 17 of 54
(1,667 Views)

To me, the suggestion to add a new "Launch top-level actor" VI is really appealing. It does, as Staab points out, remove the MQP from the first lesson (advanced users trying to integrate an actor into non-actor code would still need the MQP, but that's a pretty far down the training line thing). It makes sure that people are aware of what they're doing -- there are two items in the palettes -- and it means that it is easy to search and find independent actors by searching for this one VI. And it nicely splits the difference between the even cleaner diagram of option 2 without giving up the required input of option 1.

I really like Powell's idea.

If I go this route... can I call it "Launch Top-Level Actor.vi" and leave "Launch Actor.vi" with the same name? Changing the existing name is a serious mutation that would tie this change to a LV version bump.

0 Kudos
Message 18 of 54
(1,667 Views)

tst wrote:

I would use something like "mail box" or "inbox", that makes it clearer that this is something which is receiving messages, as opposed to "address", which is fairly generic.

Technically an address and a mailbox are different; the first is about message transport while the second is about receit.  As long as the AF isn't going to be extended such that that subtlety matters (it does, for example, in something like RabbitMQ where the terminology is "Channels" and "Queues") then "mailbox" is fine, though I prefer the genericness of "address".  I send messages to an address, even if you receive them via a mailbox.

0 Kudos
Message 19 of 54
(1,667 Views)

"Launch Top-level Actor" sounds good to me. 

0 Kudos
Message 20 of 54
(1,667 Views)