core¶
- class cyclonedds.core.Qos(*policies, base=None)[source]¶
Bases:
object
This class represents a collections of policies. It allows for easy inspection of this set. When you retrieve a Qos object from an entity modifying that object would actually does not change the Qos of the entity. To reflect this Qos objects are immutable.
- x == y
Checks if two Qos objects contain the same policies. This is a full comparison, not a match.
- x != y
Checks if two Qos objects do not contain the same policies.
- p in qos
Check if a Policy p is contained in Qos object qos. You can use all levels of generalization, for example:
Policy.History in qos
,Policy.History.KeepLast in qos
andPolicy.History.KeepLast(1) in qos
.
- qos[p]
Obtain the Policy matched with p from the Qos object, for example:
qos[Policy.History] -> Policy.History.KeepAll
- iter(x)
The Qos object supports iteration over it’s contents.
- len(x)
Return the number of Policies in the Qos object.
- str(x)
Human-readable description of the contained Qos policies.
- policies¶
A sorted tuple of the Policies contained in this Qos object
- Type
Tuple[BasePolicy]
- __init__(*policies, base=None)[source]¶
Initialize a Qos object
- Parameters
*policies (BasePolicy) – Pass in any number of constructed Policies.
base (Qos, optional) – Optionally inherit policies from another Qos object. Inherited policies are overwritten by those newly set.
- Raises
TypeError – If you pass something that is not a Policy or use a base that is not a Qos object this will be treated as a TypeError.
ValueError – If you pass two overlapping Policies, for example
Policy.History.KeepLast(10)
andPolicy.History.KeepAll
this will be treated as a ValueError.
- asdict()[source]¶
Convert a Qos object to a python dictionary.
- Returns
Fully describe the Qos object using a python dictionary with only built-in types (dict, list, string, int, boolean). This format is not guaranteed to stay consistent between cyclonedds versions but can be useful for debugging or use within an application.
- Return type
- class cyclonedds.core.Policy(**kwargs)[source]¶
The Policy class is fully static and should never need to be instantiated.
See also
qoshowto
How to work with Qos and Policy, TODO.
- class Reliability(**kwargs)[source]¶
The Reliability Qos Policy
Examples
>>> Policy.Reliability.BestEffort >>> Policy.Reliability.Reliable(max_blocking_time=duration(seconds=1))
- class Durability(**kwargs)[source]¶
The Durability Qos Policy
Examples
>>> Policy.Durability.Volatile >>> Policy.Durability.TransientLocal >>> Policy.Durability.Transient >>> Policy.Durability.Persistent
- class History(**kwargs)[source]¶
The History Qos Policy
Examples
>>> Policy.History.KeepAll >>> Policy.History.KeepLast(depth=10)
- KeepAll¶
The type of this entity is not publicly specified.
- Type
Tuple[PolicyType, Any]
- class ResourceLimits(max_samples=- 1, max_instances=- 1, max_samples_per_instance=- 1)[source]¶
The ResourceLimits Qos Policy
Examples
>>> Policy.ResourceLimits( >>> max_samples=10, >>> max_instances=10, >>> max_samples_per_instance=2 >>> )
- Parameters
- Return type
None
- class PresentationAccessScope(**kwargs)[source]¶
The Presentation Access Scope Qos Policy
Examples
>>> Policy.PresentationAccessScope.Instance(coherent_access=True, ordered_access=False) >>> Policy.PresentationAccessScope.Topic(coherent_access=True, ordered_access=False) >>> Policy.PresentationAccessScope.Group(coherent_access=True, ordered_access=False)
- class Lifespan(lifespan)[source]¶
The Lifespan Qos Policy
Examples
>>> Policy.Lifespan(duration(seconds=2))
- Parameters
lifespan (int) –
- Return type
None
- class Deadline(deadline)[source]¶
The Deadline Qos Policy
Examples
>>> Policy.Deadline(deadline=duration(seconds=2))
- Parameters
deadline (int) –
- Return type
None
- class LatencyBudget(budget)[source]¶
The Latency Budget Qos Policy
Examples
>>> Policy.LatencyBudget(duration(seconds=2))
- Parameters
budget (int) – Latency budget in nanoseconds.
- Return type
None
- class Ownership(**kwargs)[source]¶
The Ownership Qos Policy
Examples
>>> Policy.Ownership.Shared >>> Policy.Ownership.Exclusive
- Type
Policy.Ownership.Shared
- Exclusive¶
- Type
Policy.Ownership.Exclusive
- class OwnershipStrength(strength)[source]¶
The Ownership Strength Qos Policy
Examples
>>> Policy.OwnershipStrength(strength=2)
- Parameters
strength (int) – Ownership strength as integer.
- Return type
None
- class Liveliness(**kwargs)[source]¶
The Liveliness Qos Policy
Examples
>>> Policy.Liveliness.Automatic(lease_duration=duration(seconds=10)) >>> Policy.Liveliness.ManualByParticipant(lease_duration=duration(seconds=10)) >>> Policy.Liveliness.ManualByTopic(lease_duration=duration(seconds=10))
- class TimeBasedFilter(filter_time)[source]¶
The TimeBasedFilter Qos Policy
Examples
>>> Policy.TimeBasedFilter(filter_fn=duration(seconds=2))
- Parameters
filter_time (int) –
- Return type
None
- class Partition(partitions)[source]¶
The Partition Qos Policy
Examples
>>> Policy.Partition(partitions=["partition_a", "partition_b", "partition_c"]) >>> Policy.Partition(partitions=[f"partition_{i}" for i in range(100)])
- class TransportPriority(priority)[source]¶
The TransportPriority Qos Policy
Examples
>>> Policy.TransportPriority(priority=10)
- Parameters
priority (int) –
- Return type
None
- class DestinationOrder[source]¶
The DestinationOrder Qos Policy
Examples
>>> Policy.DestinationOrder.ByReceptionTimestamp >>> Policy.DestinationOrder.BySourceTimestamp
- class WriterDataLifecycle(autodispose)[source]¶
The WriterDataLifecycle Qos Policy
Examples
>>> Policy.WriterDataLifecycle(autodispose=False)
- Parameters
autodispose (bool) –
- Return type
None
- class ReaderDataLifecycle(autopurge_nowriter_samples_delay, autopurge_disposed_samples_delay)[source]¶
The ReaderDataLifecycle Qos Policy
Examples
>>> Policy.ReaderDataLifecycle( >>> autopurge_nowriter_samples_delay=duration(minutes=2), >>> autopurge_disposed_samples_delay=duration(minutes=5) >>> )
- Parameters
- Return type
None
- class DurabilityService(cleanup_delay, history, max_samples, max_instances, max_samples_per_instance)[source]¶
The DurabilityService Qos Policy
Examples
>>> Policy.DurabilityService( >>> cleanup_delay=duration(minutes=2.5), >>> history=Policy.History.KeepLast(20), >>> max_samples=2000, >>> max_instances=200, >>> max_samples_per_instance=25 >>> )
- Parameters
- Return type
None
- history¶
- Type
Policy.History.KeepAll, Policy.History.KeepLast
- class IgnoreLocal(**kwargs)[source]¶
The IgnoreLocal Qos Policy
Examples
>>> Policy.IgnoreLocal.Nothing >>> Policy.IgnoreLocal.Participant >>> Policy.IgnoreLocal.Process
- class Userdata(data)[source]¶
The Userdata Qos Policy
Examples
>>> Policy.Userdata(data=b"Hello, World!")
- Parameters
data (bytes) –
- Return type
None
- class Topicdata(data)[source]¶
The Topicdata Qos Policy
Examples
>>> Policy.Topicdata(data=b"Hello, World!")
- Parameters
data (bytes) –
- Return type
None
- class Groupdata(data)[source]¶
The Groupdata Qos Policy
Examples
>>> Policy.Groupdata(data=b"Hello, World!")
- Parameters
data (bytes) –
- Return type
None
- class Property(key, value)[source]¶
The Property Qos Policy
Examples
>>> Policy.Property(key="host", value="central")
- class BinaryProperty(key, value)[source]¶
The BinaryProperty Qos Policy
Examples
>>> Policy.BinaryProperty(key="host", value=b"central")
- class TypeConsistency(**kwargs)[source]¶
The TypeConsistency Qos Policy
Examples
>>> Policy.TypeConsistency.DisallowTypeCoercion >>> Policy.TypeConsistency.AllowTypeCoercion