Skip to content

Commit

Permalink
#118 Use FixedThreadPool instead of CachedThreadPool
Browse files Browse the repository at this point in the history
  • Loading branch information
envirover committed Apr 14, 2021
1 parent 175a493 commit 4a698a8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions UVHub/src/main/java/com/envirover/uvhub/GCSTcpServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@
public class GCSTcpServer {

private final static Logger logger = LogManager.getLogger(GCSTcpServer.class);
private final static int MAX_THREADS = 10;

private final Integer port;
private final MAVLinkChannel mtMessageQueue;
private final ExecutorService threadPool;
protected final UVShadow shadow;
private final ExecutorService threadPool;
protected final UVShadow shadow;
protected final UVLogbook logbook;

private ServerSocket serverSocket;
Expand All @@ -63,7 +64,7 @@ public class GCSTcpServer {
public GCSTcpServer(Integer port, MAVLinkChannel mtMessageQueue, UVShadow shadow, UVLogbook logbook) {
this.port = port;
this.mtMessageQueue = mtMessageQueue;
this.threadPool = Executors.newCachedThreadPool();
this.threadPool = Executors.newFixedThreadPool(MAX_THREADS);
this.shadow = shadow;
this.logbook = logbook;
}
Expand Down

0 comments on commit 4a698a8

Please sign in to comment.