theshoeshiner commented on PR #1156:
URL: https://github.com/apache/commons-lang/pull/1156#issuecomment-1885870481

   > Hello @theshoeshiner ! At a high level I am ok with the feature but the 
implementation seems seems potentially wasteful because two proxies are always 
created.
   > 
   > My thinking is that the use case should be that I know in advance if I 
want a fail-fast listener support or not. The current implementation provides 
both fail-fast and fire-all (I don't like the "quietly" name) and the call site 
decides which one to call and that's what I am questioning. Is that level of 
flexibility required? If not, then the implementation should not create two 
proxies.
   
   I agree. That was an unfortunate consequence of limitations of the 
`InvocationHandler` API, which doesnt have an easy way to pass extra context to 
the `invoke` method.
   
   In my scenario, I do use both the fail-fast and fire-all methods. If we went 
the single proxy route, this could still be accomplished by having two separate 
EventListenerSupport instances, but it would be nice if it was possible to do 
both with a single instance. If we did limit it to a single proxy then 
ultimately for my scenario I would probably have to just extend the 
EventListenerSupport class to one containing two proxies (which is kind of what 
I already do).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to