forked from ros2-java/ros2_java
-
Notifications
You must be signed in to change notification settings - Fork 9
Add publisher liveliness lost event #9
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
Merged
ivanpauno
merged 7 commits into
feature/events
from
ivanpauno/publisher-liveliness-lost-event
Aug 18, 2020
Merged
Add publisher liveliness lost event #9
ivanpauno
merged 7 commits into
feature/events
from
ivanpauno/publisher-liveliness-lost-event
Aug 18, 2020
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Collaborator
Author
|
This is targeting |
jacobperron
reviewed
Aug 18, 2020
jacobperron
left a comment
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.
The approach looks good to me. Some minor comments and suggestions below.
rcljava/src/main/java/org/ros2/rcljava/events/EventHandlerImpl.java
Outdated
Show resolved
Hide resolved
rcljava/src/main/java/org/ros2/rcljava/publisher/PublisherImpl.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
jacobperron
approved these changes
Aug 18, 2020
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Collaborator
Author
|
Merged on the feature branch, thanks for the review @jacobperron. |
ivanpauno
added a commit
that referenced
this pull request
Aug 20, 2020
* Create LivelinessLostEvent Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Fix linking issue Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Rename disposeEventHandler to removeEventHandler Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Use synchronized methods in EventHandlerImpl Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Use createEventHandler instead of registerEventHanlder Signed-off-by: Ivan Santiago Paunovic <[email protected]> * nit Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Clarify ownership of the event handle Signed-off-by: Ivan Santiago Paunovic <[email protected]>
ivanpauno
added a commit
that referenced
this pull request
Aug 31, 2020
* Create LivelinessLostEvent Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Fix linking issue Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Rename disposeEventHandler to removeEventHandler Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Use synchronized methods in EventHandlerImpl Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Use createEventHandler instead of registerEventHanlder Signed-off-by: Ivan Santiago Paunovic <[email protected]> * nit Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Clarify ownership of the event handle Signed-off-by: Ivan Santiago Paunovic <[email protected]>
ivanpauno
added a commit
that referenced
this pull request
May 17, 2021
* Create LivelinessLostEvent Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Fix linking issue Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Rename disposeEventHandler to removeEventHandler Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Use synchronized methods in EventHandlerImpl Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Use createEventHandler instead of registerEventHanlder Signed-off-by: Ivan Santiago Paunovic <[email protected]> * nit Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Clarify ownership of the event handle Signed-off-by: Ivan Santiago Paunovic <[email protected]>
ivanpauno
added a commit
to ros2-java/ros2_java
that referenced
this pull request
Dec 3, 2021
* Create LivelinessLostEvent Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Fix linking issue Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Rename disposeEventHandler to removeEventHandler Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Use synchronized methods in EventHandlerImpl Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Use createEventHandler instead of registerEventHanlder Signed-off-by: Ivan Santiago Paunovic <[email protected]> * nit Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Clarify ownership of the event handle Signed-off-by: Ivan Santiago Paunovic <[email protected]>
ivanpauno
added a commit
to ros2-java/ros2_java
that referenced
this pull request
Dec 6, 2021
* Create LivelinessLostEvent Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Fix linking issue Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Rename disposeEventHandler to removeEventHandler Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Use synchronized methods in EventHandlerImpl Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Use createEventHandler instead of registerEventHanlder Signed-off-by: Ivan Santiago Paunovic <[email protected]> * nit Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Clarify ownership of the event handle Signed-off-by: Ivan Santiago Paunovic <[email protected]>
ivanpauno
added a commit
to ros2-java/ros2_java
that referenced
this pull request
Dec 6, 2021
* Create LivelinessLostEvent Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Fix linking issue Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Rename disposeEventHandler to removeEventHandler Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Use synchronized methods in EventHandlerImpl Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Use createEventHandler instead of registerEventHanlder Signed-off-by: Ivan Santiago Paunovic <[email protected]> * nit Signed-off-by: Ivan Santiago Paunovic <[email protected]> * Clarify ownership of the event handle Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
After going a bit on circles, I think I have found an approach I'm happy with.
I don't like much the approach of passing a
Class<T>and relying on runtime reflection. That's usually a java anti-pattern (except when you really need it).Instead of passing a class, I'm passing an "event status factory" (that's what actually needed).
I'm also trying to avoid giving the user the possibility of shooting in their own feet using
disposee.g.:
That's kind of bad ....
I tried to solve the problem by ensuring that:
publisher.dispose()will also dispose it's child events.event_handler.dispose()twice isn't a problem.I guess that's a better pattern ...
There will still be a problem when disposing while the
EventHandleris used by anExecutor.Handling that correctly will require a big refactor, which is not the goal here (I only tried to avoid repeating the pre-existing problems where it was easy to do so).
Next step:
Executor.