Rebased and pre-commit checked #951
Open
+159
−40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Good evening,
I have done what you suggested on the last pull request, it was closed so I guess I have to open a new one.
The pre-commit passed and the changes should be backward compatible from my tests. I will paste what the same message I had on the previous pull request.
Topics
Topic support was present, but did not ground incoming messages in said topics, resulting in overriding duplicate keys (e.g., the timestamp). In addition, no multipart messages were used, making it difficult to actually use it with a real PUB/SUB structure.
I propose the following update to the plugin.
The plugin now can receive a two-part message, the first part is the topic (as string) and the second is the payload (the data you said PlotJuggler to expect).
Using the topic as a key to a map of parsers, it maps correctly the message to its topic. Dynamic addition of topics as they come (according to the provided filter) is supported.
The timestamp can be provided as part of the payload (as already present) or via a third part of the message. I believe this is useful if the data you are sending may not strictly contain the timestamp in the payload.
Bug fixes
I found that the application would crash after a stop of the ZMQ plugin if it was started in bind mode, this was due a bug in the shutdown method.