Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you use Drop Message Core.vi?

I understand its purpose, but it doesn't give me a reference to sender (usually the Actor's caller), so I can't do anything effective. I have to stuff that refnum and other information into the message class itself, which seems like a hack. Am I not understanding something, or was does this VI's interface need enhancement?

0 Kudos
Message 1 of 4
(3,988 Views)

The use case for Drop Message Core.vi is if the message has in its payload any reference data type whose ownership was being handed off from one actor to another actor to allow that reference to be cleaned up instead of leaked. It is most useful for a system shutting down, not a system in error recovery.

If a given message being dropped needs to talk to someone else, then the message needs to include that information within itself. AF never tracks the original sender of any message -- the overhead for doing so generally is quite high and opens the door to some interesting abuses if provided generally. Even if we decided that the overhead was acceptable, the sender may very well have already exited... only a particular application can know whether or not a given sender is expected to still be running.

For these reasons, a message that needs to message back to its sender with "I was never handled" needs to include that sender in its payload when sent.

Often if it is a message that needs acknowledgement of some sort, the sender sends a message and then goes about its merry way until a reply comes back from the other actor. In the case of a caller, you don't need any special message -- if the caller gets the Last Ack before it gets the "I finished with Do.vi" message, you know the message got dropped.

Message 2 of 4
(3,130 Views)

So I am doing it right. The framework just doesn't do what I want it to.

0 Kudos
Message 3 of 4
(3,130 Views)

We could create a new Message class for "Message With A Return To Sender If Dropped.lvclass". Any other message class that needed to have some behavior on drop could inherit from that. Do you have a use case for us all to consider to add such a thing to the framework?

0 Kudos
Message 4 of 4
(3,130 Views)