Skip to content

Commit 2061b95

Browse files
committed
FME-15373-impressions: git mv AsynchronousImpressionListener; replace ThreadFactoryBuilder with inline ThreadFactory
AI-Session-Id: 52375eb8-af89-45b8-bbad-1698b6636202 AI-Tool: claude-code AI-Model: unknown
1 parent 01c1841 commit 2061b95

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

client/src/main/java/io/split/client/impressions/AsynchronousImpressionListener.java renamed to impressions/src/main/java/io/split/client/impressions/AsynchronousImpressionListener.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.split.client.impressions;
22

3-
import com.google.common.util.concurrent.ThreadFactoryBuilder;
43
import org.slf4j.Logger;
54
import org.slf4j.LoggerFactory;
65

@@ -9,6 +8,7 @@
98
import java.util.concurrent.ThreadFactory;
109
import java.util.concurrent.ThreadPoolExecutor;
1110
import java.util.concurrent.TimeUnit;
11+
import java.util.concurrent.atomic.AtomicInteger;
1212

1313
/**
1414
* A wrapper around an ImpressionListener provided by the customer. The purpose
@@ -25,10 +25,12 @@ public class AsynchronousImpressionListener implements ImpressionListener {
2525
private final ExecutorService _executor;
2626

2727
public static AsynchronousImpressionListener build(ImpressionListener delegate, int capacity) {
28-
ThreadFactory threadFactory = new ThreadFactoryBuilder()
29-
.setDaemon(true)
30-
.setNameFormat("impression-listener-wrapper-%d")
31-
.build();
28+
AtomicInteger counter = new AtomicInteger(0);
29+
ThreadFactory threadFactory = r -> {
30+
Thread t = new Thread(r, "impression-listener-wrapper-" + counter.getAndIncrement());
31+
t.setDaemon(true);
32+
return t;
33+
};
3234

3335
ExecutorService executor = new ThreadPoolExecutor(2, 2, 0L, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(capacity), threadFactory);
3436

0 commit comments

Comments
 (0)