Skip to content

send, register_listener, and unregister_listener#78

Merged
PLeVasseur merged 7 commits into
eclipse-uprotocol:mainfrom
Xerner:register-listener
Oct 29, 2025
Merged

send, register_listener, and unregister_listener#78
PLeVasseur merged 7 commits into
eclipse-uprotocol:mainfrom
Xerner:register-listener

Conversation

@Xerner
Copy link
Copy Markdown
Contributor

@Xerner Xerner commented Sep 13, 2025

Disclaimer: This is essentially the first month I have been programming in Rust. If any Rust-specific stuff (i.e. Arc, Mutex) feels out of place or unnecessary, please leave a comment 🙂

Summary of Changes (iceoryx2 0.7.0)

  • Added packages
    • tokio: for regular use
    • iceoryx2-bb-container: for FixedSizeVec
    • hostname: to derive the hostname of the host machine when creating ServiceName instances
  • Contrary to the previous iteration that used iceoryx2 0.6.1, the UTransport trait functions now interact with iceoryx2 classes directly in their async fn definitions in Iceoryx2PubSub
  • Created a thread worker, and a dispatcher to handle creating the worker. The worker continuously runs on its own thread listening for data from publishers for its subscribers. When data arrives, it sends it to the subscribers and their respective UListener
  • Added subscriber example on how to register a UListener
  • Added publisher example on how to send a UMessage
  • Updated the UUri to ServiceName functions that handles converting UUri's into Iceoryx2 ServiceName instances. This was almost a 1-1 copy from what was in the students PRs. All I did was update their code to use uProtocols UMessageType and rely on what the expected iceoryx2 MessagingPattern will be. ❗I think it's still somewhat unfinished. Let me know if I need to put more work into it before this is good enough to merge
  • Added VS Code launch settings to debug rust with the LLDB debugger
  • Updated Java SDK version to 21 and added its version to the welcome message in the devcontainer. Hopefully this is ok. For some reason, apt-get could not find java SDK version 17 anymore and I was not sure why

Related Project Issues

@Xerner Xerner changed the title first iteration of send, register_listener, and unregister_listener send, register_listener, and unregister_listener Sep 13, 2025
Comment thread Cargo.toml Outdated
@Xerner
Copy link
Copy Markdown
Contributor Author

Xerner commented Sep 14, 2025

A short summary of these changes now exists in the PR description

Co-authored-by: kwarraich <kwarraic@andrew.cmu.edu>
Co-authored-by: Noella Horo <nhoro@andrew.cmu.edu>
Co-authored-by: vidishac2004 <144144085+vidishac2004@users.noreply.github.com>
Co-authored-by: arakabCL <arakab@andrew.cmu.edu>
@Xerner
Copy link
Copy Markdown
Contributor Author

Xerner commented Sep 14, 2025

I forgot to add the students as co-authors on the original commit 😭. Looking into how to fix this

I would like their co-authoring to be part of the original commit of this PR. That way their contribution is correctly reflected if people ever search for what exact code they helped contribute. Therefore, I amended the commit for this PR and added them as coauthors to it, and force pushed it. Sorry 😄 this will cause git pull issues if you have already checked out this PR on your local

@Xerner
Copy link
Copy Markdown
Contributor Author

Xerner commented Sep 14, 2025

I only saw 4 students just looking through their PRs commit history. Let me know if you know of anyone I missed. Here's their info

Co-authored-by: kwarraich kwarraic@andrew.cmu.edu
Co-authored-by: Noella Horo nhoro@andrew.cmu.edu
Co-authored-by: vidishac2004 144144085+vidishac2004@users.noreply.github.com
Co-authored-by: arakabCL arakab@andrew.cmu.edu

@PLeVasseur PLeVasseur self-requested a review September 14, 2025 20:34
@Xerner
Copy link
Copy Markdown
Contributor Author

Xerner commented Sep 15, 2025

So, UnsafeCell is no longer an issue and I can work directly with Iceoryx2 classes inside an async context now. Not really sure what changed, but I'm able to write this code without most of the dispatcher/worker logic now 🥳. Huge code reducing commit coming soon

Comment thread examples/common/helpers.rs Outdated
Comment thread examples/subscriber.rs Outdated
Comment thread src/lib.rs Outdated
Comment thread src/service_name_mapping.rs Outdated
Comment thread src/utransport.rs Outdated
Comment thread src/transport.rs Outdated
Comment thread src/types.rs Outdated
Comment thread src/utransport.rs Outdated
Comment thread src/utransport.rs Outdated
Comment thread src/utransport.rs Outdated
@Xerner Xerner marked this pull request as ready for review September 17, 2025 12:43
@Xerner
Copy link
Copy Markdown
Contributor Author

Xerner commented Sep 17, 2025

FYI I have rewritten the PR description based on my changes for iceoryx2 0.7.0

@Xerner
Copy link
Copy Markdown
Contributor Author

Xerner commented Sep 23, 2025

Code is ready to be reviewed again. No segmentation faults, no compile errors, and code works as intended. To run the code, open two terminals and run these commands

cargo run --example subscriber
should produce
image

cargo run --example publisher
should produce
image

@PLeVasseur
Copy link
Copy Markdown
Contributor

Nice, confirmed working on my end:
image

I may have a chance to poke around in the code during the plane flight to Berlin ✈️

Copy link
Copy Markdown
Contributor

@PLeVasseur PLeVasseur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Xerner -- this looks good.

As we chatted about, there's some extensions we'd need to make in up-rust to support true zero-copy.

Copy link
Copy Markdown
Contributor

@PLeVasseur PLeVasseur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Xerner -- this looks like a great start.

We'll need to make some extensions to up-rust to support true zero-copy in the case of using Eclipse iceoryx2 as we talked a bit about.

@PLeVasseur PLeVasseur merged commit 1935267 into eclipse-uprotocol:main Oct 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants