pymeasure / leco-protocol

Design notes for a generic communication protocol to control experiments and measurement hardware
https://leco-laboratory-experiment-control-protocol.readthedocs.io
MIT License
6 stars 3 forks source link

Data Protocol: Topic #60

Open BenediktBurger opened 9 months ago

BenediktBurger commented 9 months ago

Question

For the data protocol (via zmq PUB/SUB, see #3), message handling is based on the "topic", the first frame of a published message.

What should the topic be?

Background information on the workings of ZMQ

Be S a subscribers and P the publisher Component:

Consequences for the topic

Ideas

Regarding topic overlap

What to do about "xyz" being sent to a "xy" subscriber?

How to define the topic?

Option 1: Topic is Full name of the component

Addon subtopic: How to mark different messages fo the same Component? We could allow subtopics by adding the name of the subtopic after the Fullname. If ":" is the separator between full name and subtopic, a topic would look like "Namespace.Component1:voltages". That allows to subscribe to a part of the messages of Component1 (those regarding voltages) or to subscribe to all messages by subscribint to "Namespace.Component1". The separator could be the same one talked about in "topic overlap".

Option 2: Not tied to Full Name

My opinion

I think we should go for the full name as the topic.

I like the subtopic part, but we can add it later as well (as it is appended, it is backwards compatible)

If we allow subtopics, we could make the separator obligatory, such that we prevent topic overlap as a bonus.