Add publisher liveliness lost event#9
Merged
ivanpauno merged 7 commits intofeature/eventsfrom Aug 18, 2020
Merged
Conversation
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Collaborator
Author
|
This is targeting |
jacobperron
reviewed
Aug 18, 2020
jacobperron
left a comment
There was a problem hiding this comment.
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 <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
jacobperron
approved these changes
Aug 18, 2020
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
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 <ivanpauno@ekumenlabs.com> * Fix linking issue Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Rename disposeEventHandler to removeEventHandler Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use synchronized methods in EventHandlerImpl Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use createEventHandler instead of registerEventHanlder Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * nit Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Clarify ownership of the event handle Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
ivanpauno
added a commit
that referenced
this pull request
Aug 31, 2020
* Create LivelinessLostEvent Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Fix linking issue Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Rename disposeEventHandler to removeEventHandler Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use synchronized methods in EventHandlerImpl Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use createEventHandler instead of registerEventHanlder Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * nit Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Clarify ownership of the event handle Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
ivanpauno
added a commit
that referenced
this pull request
May 17, 2021
* Create LivelinessLostEvent Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Fix linking issue Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Rename disposeEventHandler to removeEventHandler Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use synchronized methods in EventHandlerImpl Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use createEventHandler instead of registerEventHanlder Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * nit Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Clarify ownership of the event handle Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
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 <ivanpauno@ekumenlabs.com> * Fix linking issue Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Rename disposeEventHandler to removeEventHandler Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use synchronized methods in EventHandlerImpl Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use createEventHandler instead of registerEventHanlder Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * nit Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Clarify ownership of the event handle Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
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 <ivanpauno@ekumenlabs.com> * Fix linking issue Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Rename disposeEventHandler to removeEventHandler Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use synchronized methods in EventHandlerImpl Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use createEventHandler instead of registerEventHanlder Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * nit Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Clarify ownership of the event handle Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
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 <ivanpauno@ekumenlabs.com> * Fix linking issue Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Rename disposeEventHandler to removeEventHandler Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use synchronized methods in EventHandlerImpl Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use createEventHandler instead of registerEventHanlder Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * nit Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Clarify ownership of the event handle Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
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
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.