Open arsenalzp opened 3 weeks ago
@arsenalzp Would it be OK if we implemented this in jetty-12.1.0 rather than 12.0.x? We are trying to feature freeze 12.0
@arsenalzp Would it be OK if we implemented this in jetty-12.1.0 rather than 12.0.x? We are trying to feature freeze 12.0
This approach is OK for me!
@arsenalzp good start.
Please review my comments, but I really need you to add test cases.
Of course it is good to have test cases, however as I said it is the draft, just to show the framework of solution.
I'm thinking about the place of ConnectListenerTest
test class.
Naturally it should be put inside org.eclipse.jetty.io
package, in that case it is necessary to import Server
and HttpClient
classes and it leads to modifying of pom.xml
, however it causes cyclic reference.
What do you think?
@arsenalzp put the test class in the jetty-tests/jetty-test-client-transport
module, and test it as parametrized test with transportsTCP
(see examples in that module).
@arsenalzp please also fix the formatting, see here why the build fails: https://jenkins.webtide.net/blue/organizations/jenkins/jetty.project/detail/PR-12421/3/pipeline
@arsenalzp please also fix the formatting, see here why the build fails: https://jenkins.webtide.net/blue/organizations/jenkins/jetty.project/detail/PR-12421/3/pipeline
Yeah, issue has been fixed already.
@arsenalzp another thing. Instead of calling
getBeans(ClientConnector.ConnectListener.class)
every time, which is an expensive operation, please overrideadd/removeEventListener
, and store theConnectListener
in a localCopyOnWriteArrayList
field, so the notification is faster.
Hello,
What is the idea here?
It is already implemented by superclass ContainerLifeCycle
:
private final List<Bean> _beans = new CopyOnWriteArrayList<>();
private final List<Container.Listener> _listeners = new CopyOnWriteArrayList<>();
@arsenalzp in the base class you have a field for List<Container.Listener>
so that they can be accessed efficiently without having to look up the beans all the times.
I am proposing that you do similarly in ClientConnector
, keeping a field of List<ConnectListener>
so that those listeners can be accessed very efficiently, instead of calling getBeans(ClientConnector.ConnectListener.class)
.
@arsenalzp in the base class you have a field for
List<Container.Listener>
so that they can be accessed efficiently without having to look up the beans all the times.I am proposing that you do similarly in
ClientConnector
, keeping a field ofList<ConnectListener>
so that those listeners can be accessed very efficiently, instead of callinggetBeans(ClientConnector.ConnectListener.class)
.
It is clear for me now, thank you! This improvement has just been implemented.
Here is the draft of changes proposed to solve #9529 Let's discuss it in the issue thread as the implementation was not hardened yet.