Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
JAliEn
JAliEn
Commits
c4fa3efb
Commit
c4fa3efb
authored
May 05, 2021
by
Costin Grigoras
Browse files
Allow more flexibility in executor threads
parent
b941a19d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/alien/api/DispatchSSLServerNIO.java
View file @
c4fa3efb
...
...
@@ -26,6 +26,7 @@ import java.util.concurrent.LinkedBlockingQueue;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
...
...
@@ -49,6 +50,7 @@ import alien.shell.ErrNo;
import
alien.user.AliEnPrincipal
;
import
alien.user.JAKeyStore
;
import
alien.user.UserFactory
;
import
utils.CachedThreadPool
;
/**
* @author costing
...
...
@@ -76,10 +78,12 @@ public class DispatchSSLServerNIO implements Runnable {
*/
private
static
BlockingQueue
<
Runnable
>
taskQueue
=
new
LinkedBlockingQueue
<>();
private
static
final
AtomicInteger
threadNo
=
new
AtomicInteger
();
/**
* Thread pool handling messages
*/
private
static
ThreadPoolExecutor
executor
=
new
ThreadPool
Executor
(
8
,
16
,
1
,
TimeUnit
.
MINUTES
,
taskQueue
);
private
static
ThreadPoolExecutor
executor
=
new
Cached
ThreadPool
(
200
,
1
,
TimeUnit
.
MINUTES
,
(
r
)
->
new
Thread
(
r
,
"DispatchSSLServerNIO - "
+
threadNo
.
incrementAndGet
())
);
private
static
final
int
defaultPort
=
8098
;
private
static
String
serviceName
=
"apiService"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment