Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

AF from 2012Beta to 2012Released - what is changed?

AristosQueue wrote:

Oh, right... I forgot about that one...

The reason for the change is use cases. We have very very few actual use cases for a Reply Msg, but in those few cases, getting a Message back was completely useless. In general, Messages are useless unless you have an Actor object to pass into the Do.vi. But when you're using a reply message, it is mostly from one of the appended loops in Actor Core.vi, not from the main message handling loop (because you should generally avoid hanging the main message handling loop if at all possible). In other words, there is no Actor to get the reply. So you end up putting a bunch of accessor methods on a Message class just to access the payload. That's kind of silly. It doesn't save you anything in the way of typecasting because you have to do a To More Specific on the Message class in order to use those methods. Ultimately, the reply is just a type-less data holder, and it is better to use the type-less data holder that we already have (Variant) rather than make everyone create one for each reply msg. If you want to send a Message back in that Variant, go right ahead. But this gives you an option of sending any other data home.

I appreciate this change.  It eliminates the need for my "Actorless Msg" which was a variant contained within a Message.

I have a suggestion for the Send Message And Wait For Response.vi:

Either add a Message Enqueuer.lvclass out in the top right terminal OR move the Reply output to the top right terminal.  Either choice would make for cleaner block diagrams.  Any thoughts/comments?

CLA, CTA
0 Kudos
Message 11 of 12
(765 Views)

Adding the enqueuer to the output is more consistent with other patterns and has the advantage of not breaking existing code, whereas moving the terminal would break existing callers. I'll make the update for 4.2.

0 Kudos
Message 12 of 12
(765 Views)