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 11package dev .openfeature .sdk ;
22
3+ import lombok .extern .slf4j .Slf4j ;
4+
5+ import javax .annotation .Nullable ;
36import java .util .ArrayList ;
47import java .util .List ;
58import java .util .Map ;
1114import java .util .concurrent .Executors ;
1215import java .util .function .Consumer ;
1316
14- import edu .umd .cs .findbugs .annotations .Nullable ;
15- import lombok .extern .slf4j .Slf4j ;
16-
1717/**
1818 * Util class for storing and running handlers.
1919 */
@@ -23,9 +23,13 @@ class EventSupport {
2323 // we use a v4 uuid as a "placeholder" for anonymous clients, since
2424 // ConcurrentHashMap doesn't support nulls
2525 private static final String defaultClientUuid = UUID .randomUUID ().toString ();
26- private final ExecutorService taskExecutor = Executors .newCachedThreadPool ();
2726 private final Map <String , HandlerStore > handlerStores = new ConcurrentHashMap <>();
2827 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+ });
2933
3034 /**
3135 * 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 {
2222
2323 private final Map <String , FeatureProvider > providers = new ConcurrentHashMap <>();
2424 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+ });
2630
2731 /**
2832 * Return the default provider.
You can’t perform that action at this time.
0 commit comments