rticommunity / connextdds-py

Connext DDS Python API
Other
26 stars 12 forks source link

Connectors Blocking? #43

Closed aris-t closed 2 years ago

aris-t commented 2 years ago

Interesting case where creating one DDS reader appears to block the reading ability of another? If the creation of the first is commented out the second will receive messages. Holding off on XML unless necessary. Have confirmed both connectors will be created and operate independently so doubt it is an XML issue.

connectors.py

def ddsReader(subscriberType,readerType):
    DDS_config = "DomainParticipantLibrary::DomainParticipant"
    DDS_xml = "./myQOS.xml"
    connector=rti.Connector(config_name=DDS_config,url=DDS_xml)
    dds_reader = connector.get_input(f"{subscriberType}::{readerType}")
    return dds_reader

invoke.py

from connectors import ddsReader
A_Listener = ddsReader("Subscriber","TopicAReader")
B_Listener = ddsReader("Subscriber","TopicBReader")

while True:
    A_Listener.take()
    for sample in A_Listener.samples.valid_data_iter:
        print(sample)

    B_Listener.take() # Never gets sample if A_Listener is created first
    for sample in B_Listener.samples.valid_data_iter:
        print(sample)
marc-chiesa commented 2 years ago

You are probably looking for the RTI Connector for Python project. This project is the experimental full Python API.

samuelraeburn commented 2 years ago

Same discussion happening in https://github.com/rticommunity/rticonnextdds-connector-py/issues/127