Skip to content

Commit

Permalink
Merge 9c1f2f6 into 265bf6e
Browse files Browse the repository at this point in the history
  • Loading branch information
zolmk authored Nov 2, 2023
2 parents 265bf6e + 9c1f2f6 commit ac7d69a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiFunction;
import java.util.function.Supplier;

/**
* Unified event notify center.
Expand All @@ -43,7 +44,7 @@ public class NotifyCenter {

private DefaultSharePublisher sharePublisher;

private static EventPublisher eventPublisher = new DefaultPublisher();
private static final Supplier<EventPublisher> publisherSupplier = DefaultPublisher::new;

Check warning on line 47 in threadpool/server/config/src/main/java/cn/hippo4j/config/notify/NotifyCenter.java

View check run for this annotation

Codecov / codecov/patch

threadpool/server/config/src/main/java/cn/hippo4j/config/notify/NotifyCenter.java#L47

Added line #L47 was not covered by tests

private static BiFunction<Class<? extends AbstractEvent>, Integer, EventPublisher> publisherFactory;

Expand All @@ -52,7 +53,7 @@ public class NotifyCenter {
static {
publisherFactory = (cls, buffer) -> {
try {
EventPublisher publisher = eventPublisher;
EventPublisher publisher = publisherSupplier.get();

Check warning on line 56 in threadpool/server/config/src/main/java/cn/hippo4j/config/notify/NotifyCenter.java

View check run for this annotation

Codecov / codecov/patch

threadpool/server/config/src/main/java/cn/hippo4j/config/notify/NotifyCenter.java#L56

Added line #L56 was not covered by tests
publisher.init(cls, buffer);
return publisher;
} catch (Throwable ex) {
Expand Down

0 comments on commit ac7d69a

Please sign in to comment.