Some of the pub/sub examples within the rust_pubsub and minimal_pub_sub crates seem slightly redundant. In particular, the rust_pubsub/simple_{publisher,subscriber} and minimal_pub_sub/minimal_{publisher,subscriber} examples seem to duplicate each other. Furthermore, some may find the multiplicity of pub/sub examples confusing (see discussion on Matrix).
Therefore, I propose that the pub/sub examples be consolidated into a single crate. I'm imagining something like this:
- Remove the
rust_pubsub crate since the features it demonstrates overlap with the minimal_subscriber+minimal_publisher example in the minimal_pub_sub crate.
- Ensure there's a separate launch file for each example in the
minimal_pub_sub crate (some examples don't have a launch file).
- I propose each of three separate examples have its own launch file: (1)
minimal_subscriber+minimal_publisher, (2) zero_copy_publisher+zero_copy_subscriber, (3) minimal_two_nodes. The goal is to clarify how the examples are intended to be run, supporting the reader in understanding which files go together.
- Optionally refactor code in the
minimal_pub_sub crate so it uses the pattern of always using a struct for a node.
- The
rust_pubsub crate follows the pattern of defining a struct for each node (e.g. SimpleSubscriptionNode/SimplePublisherNode) while most examples in the minimal_pub_sub skip the struct and simply use variables inline within the main function. I'm presuming the node-struct pattern is more idiomatic since it's the one used in the documentation.
- Optionally rename the
minimal_pub_sub crate to pub_sub_demo so its naming better aligns with other crates in the repository.
I'm open to any suggestions and ideas. I'm new to the project so apologies in advance if I'm proposing anything foolish.
Some of the pub/sub examples within the
rust_pubsubandminimal_pub_subcrates seem slightly redundant. In particular, therust_pubsub/simple_{publisher,subscriber}andminimal_pub_sub/minimal_{publisher,subscriber}examples seem to duplicate each other. Furthermore, some may find the multiplicity of pub/sub examples confusing (see discussion on Matrix).Therefore, I propose that the pub/sub examples be consolidated into a single crate. I'm imagining something like this:
rust_pubsubcrate since the features it demonstrates overlap with theminimal_subscriber+minimal_publisherexample in theminimal_pub_subcrate.minimal_pub_subcrate (some examples don't have a launch file).minimal_subscriber+minimal_publisher, (2)zero_copy_publisher+zero_copy_subscriber, (3)minimal_two_nodes. The goal is to clarify how the examples are intended to be run, supporting the reader in understanding which files go together.minimal_pub_subcrate so it uses the pattern of always using a struct for a node.rust_pubsubcrate follows the pattern of defining a struct for each node (e.g.SimpleSubscriptionNode/SimplePublisherNode) while most examples in theminimal_pub_subskip the struct and simply use variables inline within themainfunction. I'm presuming the node-struct pattern is more idiomatic since it's the one used in the documentation.minimal_pub_subcrate topub_sub_demoso its naming better aligns with other crates in the repository.I'm open to any suggestions and ideas. I'm new to the project so apologies in advance if I'm proposing anything foolish.