Skip to content

Commit

Permalink
only use UE for local server.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellblazer committed Jun 3, 2024
1 parent 0dcd865 commit f168888
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
import org.slf4j.LoggerFactory;

import java.security.PublicKey;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
Expand Down Expand Up @@ -269,6 +266,7 @@ private Map<Digest, Member> assemblyOf(List<Digeste> committee) {
var last = view.pendingViews().last();
return committee.stream()
.map(d -> last.context().getMember(Digest.from(d)))
.filter(Objects::nonNull)
.collect(Collectors.toMap(Member::getId, m -> m));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.function.Supplier;
Expand All @@ -45,7 +46,7 @@ public class Enclave implements RouterSupplier {
private final static Class<? extends io.netty.channel.Channel> channelType = IMPL.getChannelType();
private static final Logger log = LoggerFactory.getLogger(Enclave.class);

private final Executor executor = UnsafeExecutors.newVirtualThreadPerTaskExecutor();
private final Executor executor = Executors.newVirtualThreadPerTaskExecutor();
private final DomainSocketAddress bridge;
private final Consumer<Digest> contextRegistration;
private final DomainSocketAddress endpoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
Expand All @@ -70,7 +71,7 @@ public MtlsServer(Member from, EndpointProvider epProvider, Function<Member, Cli
this.epProvider = epProvider;
this.contextSupplier = contextSupplier;
this.supplier = supplier;
this.executor = UnsafeExecutors.newVirtualThreadPerTaskExecutor();
this.executor = Executors.newVirtualThreadPerTaskExecutor();
cachedMembership = CacheBuilder.newBuilder().build(new CacheLoader<X509Certificate, Digest>() {
@Override
public Digest load(X509Certificate key) throws Exception {
Expand Down Expand Up @@ -147,8 +148,7 @@ public RouterImpl router(ServerConnectionCache.Builder cacheBuilder, Supplier<Li
limitsBuilder.metricRegistry(limitsRegistry);
}
NettyServerBuilder serverBuilder = NettyServerBuilder.forAddress(epProvider.getBindAddress())
.executor(
UnsafeExecutors.newVirtualThreadPerTaskExecutor())
.executor(executor)
.withOption(ChannelOption.SO_REUSEADDR, true)
.sslContext(supplier.forServer(ClientAuth.REQUIRE,
epProvider.getAlias(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.io.IOException;
import java.time.Duration;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;

Expand All @@ -37,7 +38,7 @@
public class Portal<To extends Member> {
private final static Class<? extends io.netty.channel.Channel> channelType = IMPL.getChannelType();

private final Executor executor = UnsafeExecutors.newVirtualThreadPerTaskExecutor();
private final Executor executor = Executors.newVirtualThreadPerTaskExecutor();
private final String agent;
private final EventLoopGroup eventLoopGroup = IMPL.getEventLoopGroup();
private final Demultiplexer inbound;
Expand Down

0 comments on commit f168888

Please sign in to comment.