use of io.netty.channel.group.DefaultChannelGroup in project reactor-netty by reactor.
the class HttpServerTests method testTcpConfiguration_2.
@Test
@SuppressWarnings("deprecation")
void testTcpConfiguration_2() throws Exception {
CountDownLatch latch = new CountDownLatch(10);
LoopResources loop = LoopResources.create("testTcpConfiguration");
ChannelGroup group = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);
doTestTcpConfiguration(HttpServer.from(configureTcpServer(TcpServer.create(), loop, group, latch)), HttpClient.from(configureTcpClient(TcpClient.create(), loop, group, latch)));
assertThat(latch.await(30, TimeUnit.SECONDS)).isTrue();
FutureMono.from(group.close()).then(loop.disposeLater()).block(Duration.ofSeconds(30));
}
use of io.netty.channel.group.DefaultChannelGroup in project cdap by caskdata.
the class NettyRouter method startUp.
@Override
protected void startUp() throws Exception {
// If internal authorization enforcement is enabled, we avoid re-initialization of the token manager.
if (SecurityUtil.isManagedSecurity(cConf) && !SecurityUtil.isInternalAuthEnabled(cConf)) {
tokenValidator.startAndWait();
}
ChannelGroup channelGroup = new DefaultChannelGroup(ImmediateEventExecutor.INSTANCE);
serverCancellable = startServer(createServerBootstrap(channelGroup), channelGroup);
scheduleConfigReloadThread();
}
use of io.netty.channel.group.DefaultChannelGroup in project netty by netty.
the class ThreadPerChannelEventLoopGroupTest method runTest.
private static void runTest(ThreadPerChannelEventLoopGroup loopGroup) throws InterruptedException {
int taskCount = 100;
EventExecutor testExecutor = new TestEventExecutor();
ChannelGroup channelGroup = new DefaultChannelGroup(testExecutor);
while (taskCount-- > 0) {
Channel channel = new EmbeddedChannel(NOOP_HANDLER);
loopGroup.register(new DefaultChannelPromise(channel, testExecutor));
channelGroup.add(channel);
}
channelGroup.close().sync();
loopGroup.shutdownGracefully(100, 200, TimeUnit.MILLISECONDS).sync();
assertTrue(loopGroup.isTerminated());
}
use of io.netty.channel.group.DefaultChannelGroup in project serve by pytorch.
the class ServerGroups method init.
public final void init() {
allChannels = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);
serverGroup = Connector.newEventLoopGroup(2);
childGroup = Connector.newEventLoopGroup(configManager.getNettyThreads());
if (configManager.isMetricApiEnable()) {
metricsGroup = Connector.newEventLoopGroup(1);
}
backendGroup = Connector.newEventLoopGroup(configManager.getNettyClientThreads());
}
use of io.netty.channel.group.DefaultChannelGroup in project cdap by cdapio.
the class NettyRouter method startUp.
@Override
protected void startUp() throws Exception {
// If internal authorization enforcement is enabled, we avoid re-initialization of the token manager.
if (SecurityUtil.isManagedSecurity(cConf) && !SecurityUtil.isInternalAuthEnabled(cConf)) {
tokenValidator.startAndWait();
}
ChannelGroup channelGroup = new DefaultChannelGroup(ImmediateEventExecutor.INSTANCE);
serverCancellable = startServer(createServerBootstrap(channelGroup), channelGroup);
scheduleConfigReloadThread();
}
Aggregations