pub

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

Bases: cyclonedds.core.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: cyclonedds.core.Entity, Generic[cyclonedds.pub._T]

Parameters
property topic: cyclonedds.topic.Topic[cyclonedds.pub._T]
write(sample, timestamp=None)[source]
Parameters
  • sample (cyclonedds.pub._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 (cyclonedds.pub._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 (cyclonedds.pub._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 (cyclonedds.pub._T) –

Return type

int

unregister_instance(sample, timestamp=None)[source]
Parameters
  • sample (cyclonedds.pub._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 (cyclonedds.pub._T) –

Return type

Optional[int]