pub

class cyclonedds.pub.Publisher(domain_participant, qos=None, listener=None)[source]

Bases: Entity

Parameters:
suspend()[source]
resume()[source]
wait_for_acks(timeout)[source]

This operation blocks the calling thread until either all data written by the publisher or writer is acknowledged by all matched reliable reader entities, or else the duration specified by the timeout parameter elapses, whichever happens first.

Parameters:

timeout (int) – The maximum number of nanoseconds to wait. Use the function duration to write that in a human readable format.

class cyclonedds.pub.DataWriter(publisher_or_participant, topic, qos=None, listener=None)[source]

Bases: Entity, Generic[_T]

Parameters:
property topic: Topic[_T]
write(sample, timestamp=None)[source]
Parameters:
  • sample (_T) – The sample to write

  • timestamp (Optional[int]) – The sample’s source_timestamp (in nanoseconds since the UNIX Epoch)

write_dispose(sample, timestamp=None)[source]

Similar to write() but also marks the sample for disposal by setting its InstanceState to NotAliveDisposed.

Parameters:
  • sample (_T) – The sample to dispose

  • timestamp (Optional[int]) – The sample’s source_timestamp (in nanoseconds since the UNIX Epoch)

dispose(sample, timestamp=None)[source]

Marks the sample for disposal by setting its InstanceState to NotAliveDisposed.

Parameters:
  • sample (_T) – The sample to dispose

  • timestamp (Optional[int]) – The sample’s source_timestamp (in nanoseconds since the UNIX Epoch)

dispose_instance_handle(handle, timestamp=None)[source]

Marks the instance and all samples associated wiht the given handle for disposal by setting their InstanceState to NotAliveDisposed.

Parameters:
register_instance(sample)[source]
Parameters:

sample (_T) –

Return type:

int

unregister_instance(sample, timestamp=None)[source]
Parameters:
  • sample (_T) – The sample to unregister

  • timestamp (Optional[int]) – The timestamp used at registration (in nanoseconds since the UNIX Epoch)

unregister_instance_handle(handle, timestamp=None)[source]
Parameters:
wait_for_acks(timeout)[source]

This operation blocks the calling thread until either all data written by the publisher or writer is acknowledged by all matched reliable reader entities, or else the duration specified by the timeout parameter elapses, whichever happens first.

Parameters:

timeout (int) – The maximum number of nanoseconds to wait. Use the function duration to write that in a human readable format.

Return type:

bool

lookup_instance(sample)[source]

This operation takes a sample and returns an instance handle to be used for subsequent operations.

Parameters:

sample (_T) –

Return type:

Optional[int]

get_matched_subscriptions()[source]

Get instance handles of the data readers matching a writer.

Raises:

DDSException – When the number of matching readers < 0.:

Returns:

A list of instance handles of the matching data readers.

Return type:

List[int]

property matched_sub: List[int]

Get instance handles of the data readers matching a writer.

Raises:

DDSException – When the number of matching readers < 0.:

Returns:

A list of instance handles of the matching data readers.

Return type:

List[int]

get_matched_subscription_data(handle)[source]

Get a description of a reader matched with the provided writer

Parameters:

handle (Int) – The instance handle of a reader.

Returns:

The sample of the DcpsEndpoint built-in topic.

Return type:

DcpsEndpoint

get_liveliness_lost_status()[source]

Get LIVELINESS_LOST status

Raises:

DDSException

Returns:

The class ‘liveness_lost_status’ value.

Return type:

liveness_lost_status

get_offered_deadline_missed_status()[source]

Get OFFERED DEADLINE MISSED status

Raises:

DDSException

Returns:

The class ‘offered_deadline_missed_status’ value.

Return type:

offered_deadline_missed_status

get_offered_incompatible_qos_status()[source]

Get OFFERED INCOMPATIBLE QOS status

Raises:

DDSException

Returns:

The class ‘offered_incompatible_qos_status’ value.

Return type:

offered_incompatible_qos_status

get_publication_matched_status()[source]

Get PUBLICATION MATCHED status

Raises:

DDSException

Returns:

The class ‘publication_matched_status’ value.

Return type:

publication_matched_status