Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer Consumer across actor

What inputs do you have in your actor core? Since it is an framework override, it should have dynamic dispatch input "ActorIn" and this should be an actor object. Your producer has two error out.

I would repair this first to increase readability (to use a constant disables also PreLaunch Init). The rest of the producer actor seems fine to me (except that the block diagram look very messy).

The consumer actor core cannot work like this.

It seems that you want to show the data within the actor core and update actor core every time the consumer consumes.

If you want to do so, I would recommend to put a reference to the element that shows the data in the actor private data cluster and update this element by the consume method as shown below. To do so you must put a Ref of your frontpanel element to your private date cluster. Thus an event loop in the consumer actor core is not needed.

consumer_neu.jpg

Edit: In addition: One of the main advantages of the actor framework for me is, that within an actor nearly everything is processed sequentially. If you put an event loop without need, you break this huge advantage.

0 Kudos
Message 11 of 13
(1,137 Views)

You don't need to do anything special to make sure the consumer is done.  A normal (not emergency) stop will suffice.

CaseyLamers1 and wrkcrw00 are generally correct; use the framework as-is.  The producer may have a helper loop producing data, but it should send it to the consumer via a regular AF message.  The consumer does not need a helper loop, just a "Log Data" method, and a message to go with it.

Those messages will stack up in the consumer's regular queue.  When the consumer receives a normal stop message (perhaps sent by the producer when it stops running), that stop message will be added to the end of the queue, after all of your Log Data messages.  The consumer will process any remaining Log Data messages, and then will process the stop.

0 Kudos
Message 12 of 13
(1,137 Views)

Thank you for all your contributions!  You've really helped me learn the actor framework.

0 Kudos
Message 13 of 13
(608 Views)