What does take do exactly?

2 posts / 0 new
Last post
Last seen: 6 years 7 months ago
Joined: 09/17/2015
Posts: 53
What does take do exactly?

Hello all,

The RTI Manual is confusing. It says take() removes the samples from the datareader queue and from DDS Connext. But what does that mean if:

  1. I have two data readers listening on the same topic? Does take remove the data also from the other data reader if I apply it to one.
  2. What happens with different publishers / subscribers?
  3. Or is it even domain wide?

Best regards,


Gerardo Pardo's picture
Last seen: 1 week 1 day ago
Joined: 06/02/2010
Posts: 602


I agree this is confusing. The DataReader take() operation only affects that DataReader itself. 

In Connext DDS each DataReader has its own SampleHistory Cache. These is where all the samples received by that DataReader are stored along with meta-data like the SampleInfo (who sent the sample, the sequence numbers, timestamps, statuses, etc.). 

If there are two DataRerader listening to the same Topic then each has its own separate SampleHistory cache. This is true even if these two DataReaders are in the same computer or even on the same process. Consequently if the two DataReaders need to receive the same sample (which is not always the case as they could have different content filters, time filters, etc.) then the Sample (and SampleInfo) is copied to each of the respective DataReader SampleHistory caches. So the fact that one DataReader takes the sample does not affect the others at all.