-
Notifications
You must be signed in to change notification settings - Fork 42
Remove ClientChannelView #286
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the change, it's how I originally wrote it and then changed my mind in the code review. I think the worry was exposing websocket protocol specific types in the callbacks, but those callbacks are very websocket and sometimes ros specific anyway.
For Python I see you opted not to expose the additional info other than the topic and id. We'll have to remember to come back and fix that. Unfortunately it all means allocating and copying in Python, there's no way around that - because Python is able to store a reference to ClientChannel in a way that escapes the callback. Rust cannot.
I think C and C++ have the same problems as Python, not sure how we deal with that there in performance may matter land. Maybe we give them a pointer or reference to an object with borrowed data (string_view or similar for c++?) and document that they have to copy it if they want to keep it after the callback returns.
Updated to expose the info to Python as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only took a quick look at the rust source since it'd been reviewed already, but this looks good to me.
### Changelog C/C++: added callbacks for client advertise, publish, and unadvertise ### Docs None ### Description ~Depends on #286~
Changelog
Rust: callbacks for on_client_advertise, on_client_unadvertise, and on_message_data now receive a
&ClientChannel
instead of aClientChannelView
.Python: callback for on_client_advertise now receives a
ClientChannel
instead of aChannelView
; on_client_unadvertise and on_message_data now receive aclient_channel_id
instead of aChannelView
.Docs
None
Description
Motivation: all the information about the client channel should be accessible to users in the callbacks.
Thoughts?