Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

What do you use to stream data in AF?

Solved!
Go to solution

Hi all,

Based on https://decibel.ni.com/content/thread/20890?tstart=0, it sounds like a lot of people have applications that stream data between actors outside of AF messsages (ie: for live data display).  Since shared variables clearly have some drawbacks as discussed in the link, what do you use to stream data between actors?

CLAD
0 Kudos
Message 1 of 7
(6,120 Views)
Solution
Accepted by topic author testingHotAir

Queues!

0 Kudos
Message 2 of 7
(3,803 Views)

Network Streams

CLA, CTA
Message 3 of 7
(3,803 Views)

Todd:  Do you have any update rate issues with using queues for streaming data?  I have a requirement for an indicator to update at 10Hz from the acquisition device.  Using messages to accomplish this so far has not met the required update rate.  LVB:  I've been looking at network streams this morning, but the one-to-one nature of streams isn't compatible with my system since I allow multiple consumers (say, a UI and a logger) to follow one producer.  That fact was what led me to the SV's in the first place, of course.

CLAD
0 Kudos
Message 4 of 7
(3,803 Views)

I'll go out on a limb and say your problem isn't due to the queues.  10 Hz is nothing... I've had queues move hundreds of messages per second without breaking a sweat and seen reports of them moving thousands of messages per second.

0 Kudos
Message 5 of 7
(3,803 Views)

To use queues to pass streaming data, I'd need to send the new data from the actor that generated/acquired it to an actor that forwards the message to any actor that is listening.  Sounds like a lot of overhead, but maybe that points out a weakness in my approach...

CLAD
0 Kudos
Message 6 of 7
(3,803 Views)

I set up a new project today that uses queues to stream data.  With three producers totally 25 channels firing at the controller and one consumer, I'm seeing elapsed times of 4ms to buffer the data and send it on to the consumer.  This is WAY faster than shared variables!  To handle the one to many requirement, I have each consumer register their message queue with the controller.  When new data is uploaded, the controller sends a copy of the data via message to each subscriber.  Data upload and data forwarding messages are type specific, but the code duplication is minimal.  As long as each consumer at least has a method for each type of data forwarding message, there is no problem.  Thank you everyone for your input!

CLAD
0 Kudos
Message 7 of 7
(3,803 Views)