File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
src/main/java/dev/openfeature/sdk Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1
1
package dev .openfeature .sdk ;
2
2
3
+ import lombok .extern .slf4j .Slf4j ;
4
+
5
+ import javax .annotation .Nullable ;
3
6
import java .util .ArrayList ;
4
7
import java .util .List ;
5
8
import java .util .Map ;
11
14
import java .util .concurrent .Executors ;
12
15
import java .util .function .Consumer ;
13
16
14
- import edu .umd .cs .findbugs .annotations .Nullable ;
15
- import lombok .extern .slf4j .Slf4j ;
16
-
17
17
/**
18
18
* Util class for storing and running handlers.
19
19
*/
@@ -23,9 +23,13 @@ class EventSupport {
23
23
// we use a v4 uuid as a "placeholder" for anonymous clients, since
24
24
// ConcurrentHashMap doesn't support nulls
25
25
private static final String defaultClientUuid = UUID .randomUUID ().toString ();
26
- private final ExecutorService taskExecutor = Executors .newCachedThreadPool ();
27
26
private final Map <String , HandlerStore > handlerStores = new ConcurrentHashMap <>();
28
27
private final HandlerStore globalHandlerStore = new HandlerStore ();
28
+ private final ExecutorService taskExecutor = Executors .newCachedThreadPool (runnable -> {
29
+ final Thread thread = new Thread (runnable );
30
+ thread .setDaemon (true );
31
+ return thread ;
32
+ });
29
33
30
34
/**
31
35
* Run all the event handlers associated with this client name.
Original file line number Diff line number Diff line change @@ -22,7 +22,11 @@ class ProviderRepository {
22
22
23
23
private final Map <String , FeatureProvider > providers = new ConcurrentHashMap <>();
24
24
private final AtomicReference <FeatureProvider > defaultProvider = new AtomicReference <>(new NoOpProvider ());
25
- private final ExecutorService taskExecutor = Executors .newCachedThreadPool ();
25
+ private final ExecutorService taskExecutor = Executors .newCachedThreadPool (runnable -> {
26
+ final Thread thread = new Thread (runnable );
27
+ thread .setDaemon (true );
28
+ return thread ;
29
+ });
26
30
27
31
/**
28
32
* Return the default provider.
You can’t perform that action at this time.
0 commit comments