Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop scheme for message topics #606

Closed
jamessynge opened this issue Sep 18, 2018 · 2 comments
Closed

Develop scheme for message topics #606

jamessynge opened this issue Sep 18, 2018 · 2 comments
Assignees
Milestone

Comments

@jamessynge
Copy link
Contributor

We have a grab bag of existing topics used with PanMessaging. I'd like to develop a scheme for hierarchical topics, taking advantage of the prefix filtering that ZeroMQ offers. This should be recorded in a markdown file, probably under source control rather than in the wiki.

@jamessynge
Copy link
Contributor Author

Regarding topic names, given that ZeroMQ has literal prefix filtering (not regexp), I suggest that we use dotted names for topics (ala Python & Java package names). Furthermore, to eliminate the possibility of a leaf topic (i.e. the topic used by a publisher when sending a message) also matching as the prefix of some other, longer topic name, I suggest that all leaf topic names end with a $ (dollar sign).
For consistency, I recommend that we only use lower-case names.

When a subscriber wants to filter on a group of topics with a common prefix, the filter should end with a . (period), unless subscribing to all topics, in which case the filter is the empty string. This reinforces the idea that dotted names are intended for semantic grouping. We could hide some of these details by introducing classes or class instances representing topics and topic groups. For example:

t = PanMessaging.create_topic_name('pocs_shell.in.command')
t  -->  TopicName('pocs_shell.in.command$')
g = t.parent_group_name()
g  -->  TopicGroupName('pocs_shell.in.')
g = g.parent_group_name()
g  -->  TopicGroupName('pocs_shell.')
g = g.parent_group_name()
g  -->  TopicGroupName('')
g = g.parent_group_name()
g  -->  TopicGroupName('')

g = PanMessage.root_topic_group_name()
g  -->  TopicGroup('')

We have these existing topics (excluding those used in tests):

  • PANCHAT (sent from POCS.say)
    This is used to broadcast messages intended for humans. Subscribed to by PAWS and social_messaging.
    Suggested name: pocs.out.chat$
  • PAWS-CMD (sent from PAWS websockets.py, received by pocs_shell)
    Suggested name: pocs_shell.in.command$
    This should probably be combined with POCS-CMD once we create a non-shell version of pocs_shell (i.e. a daemon that runs the observatory, receives commands, reports status, etc.).
  • POCS (sent by class POCS)
    This is the default topic for POCS.send_message, but I think all the non-test callers provide a topic, and only one test does not provide a specific topic. We should probably eliminate this topic.
  • POCS-CMD (sent by pocs_shell, received by class POCS, and also by some tests in order to shutdown POCS)
    Suggested name: pocs.in.command$
  • STATUS (sent by class POCS)
    I'm not entirely clear how this is received, but I assume that it some how goes from POCS to PAWS to the browser javascript.
    Suggested name: pocs.out.status$
  • weather (from peas/sensors.py)
    Suggested name: sensor.weather$
  • environment (from peas/sensors.py)
    I suggest that we drop this in place of the following two messages which ArduinoIO will produce (the names are derived automatically from the board name).sensor.weather$
  • telemetry:commands (in ArduinoIO... new)
    Suggested name: sensor.telemetry_board$
  • camera:commands (in ArduinoIO... new)
    Suggested name: sensor.camera_board$

@wtgee wtgee added this to the V1.0 milestone Feb 17, 2020
@wtgee
Copy link
Member

wtgee commented Jun 1, 2020

Messaging was eliminated in #951. The ideas here are relevant but it might also be worth just starting a new issue. Closing as stale.

@wtgee wtgee closed this as completed Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants