File tree Expand file tree Collapse file tree 2 files changed +41
-2
lines changed
core/src/main/java/com/linecorp/armeria/client Expand file tree Collapse file tree 2 files changed +41
-2
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,8 @@ public final class ClientFactoryBuilder implements TlsSetters {
136136 private ClientTlsConfig tlsConfig ;
137137 private boolean staticTlsSettingsSet ;
138138 private boolean autoCloseConnectionPoolListener = true ;
139- private ClientRequestLifecycleListener clientRequestLifecycleListener =
140- new ClientRequestMetrics ();
139+ private ClientRequestLifecycleListener clientRequestLifecycleListener =
140+ ClientRequestLifecycleListener . noop ();
141141
142142 ClientFactoryBuilder () {
143143 connectTimeoutMillis (Flags .defaultConnectTimeoutMillis ());
Original file line number Diff line number Diff line change @@ -42,4 +42,43 @@ static ClientRequestMetrics counting() {
4242 return new ClientRequestMetrics ();
4343 }
4444
45+ static ClientRequestLifecycleListener noop () {
46+ return NoopClientRequestLifecycleListener .INSTANCE ;
47+ }
48+
49+ class NoopClientRequestLifecycleListener implements ClientRequestLifecycleListener {
50+
51+ private static final NoopClientRequestLifecycleListener INSTANCE = new NoopClientRequestLifecycleListener ();
52+
53+ @ Override
54+ public void onRequestPending (ClientRequestContext ctx ) {
55+ // no-op
56+ }
57+
58+ @ Override
59+ public void onRequestStart (ClientRequestContext ctx ) {
60+ // no-op
61+ }
62+
63+ @ Override
64+ public void onRequestSendComplete (ClientRequestContext ctx ) {
65+ // no-op
66+ }
67+
68+ @ Override
69+ public void onResponseHeaders (ClientRequestContext ctx , ResponseHeaders headers ) {
70+ // no-op
71+ }
72+
73+ @ Override
74+ public void onResponseComplete (ClientRequestContext ctx ) {
75+ // no-op
76+ }
77+
78+ @ Override
79+ public void onRequestComplete (ClientRequestContext ctx , @ Nullable Throwable cause ) {
80+ // no-op
81+ }
82+ }
83+
4584}
You can’t perform that action at this time.
0 commit comments