The purpose of this QoS is to avoid delivering stale data to the application. Each DDS sample written by a DataWriter has an associated expiration time, beyond which the data should not be delivered to any application. Once the DDS sample expires, the data will be removed from the DataReader caches, as well as from the transient and persistent information caches.
The middleware attaches timestamps to all data sent and received. The expiration time of each DDS sample is computed by adding the duration specified by this QoS to the destination timestamp. To avoid inconsistencies, if you have multiple DataWriters of the same instance, they should all use the same value for this QoS.
When you specify a finite Lifespan for your data, Connext DDS will compare the current time with those timestamps and drop data when your specified Lifespan expires.
The Lifespan QosPolicy can be used to control how much data is stored by Connext DDS. Even if it is configured to store "all" of the data sent or received for a topic (see the HISTORY QosPolicy), the total amount of data it stores may be limited by the Lifespan QosPolicy.
You may also use the Lifespan QosPolicy to ensure that applications do not receive or act on data, commands or messages that are too old and have "expired.”
It includes the single member listed in Table 48 . For default and valid range, please refer to the API Reference HTML documentation.
Type |
Field Name |
Description |
DDS_Duration_t |
duration |
Maximum duration for the data's validity. |
Although you can set the LIFESPAN QosPolicy on Topics, its value can only be used to initialize the LIFESPAN QosPolicies of DataWriters. The Topic’s setting for this QosPolicy does not directly affect the operation of Connext DDS, see Setting Topic QosPolicies.
This QoS policy can be modified after the entity is enabled.
It does not apply to DataReaders, so there is no requirement that the publishing and subscribing sides use compatible values.
The use of this policy does not significantly impact the use of resources.
© 2015 RTI