Commit 5a5211acf89ca278ff9bfe5768fad4bd3ec40b0f
1 parent
6a779352
Performance improvement for websocket updates
Showing
1 changed file
with
4 additions
and
1 deletions
... | ... | @@ -72,6 +72,9 @@ import java.util.concurrent.ConcurrentHashMap; |
72 | 72 | import java.util.concurrent.ConcurrentMap; |
73 | 73 | import java.util.concurrent.ExecutorService; |
74 | 74 | import java.util.concurrent.Executors; |
75 | +import java.util.concurrent.SynchronousQueue; | |
76 | +import java.util.concurrent.ThreadPoolExecutor; | |
77 | +import java.util.concurrent.TimeUnit; | |
75 | 78 | import java.util.function.Consumer; |
76 | 79 | import java.util.stream.Collectors; |
77 | 80 | |
... | ... | @@ -112,7 +115,7 @@ public class DefaultTelemetryWebSocketService implements TelemetryWebSocketServi |
112 | 115 | |
113 | 116 | @PostConstruct |
114 | 117 | public void initExecutor() { |
115 | - executor = Executors.newSingleThreadExecutor(); | |
118 | + executor = new ThreadPoolExecutor(0, 50, 60L, TimeUnit.SECONDS, new SynchronousQueue<>()); | |
116 | 119 | } |
117 | 120 | |
118 | 121 | @PreDestroy | ... | ... |