You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/08/06 07:52:29 UTC
[GitHub] [shardingsphere] dachuan9e commented on a change in pull request #11678: Refactor proxy init and start
dachuan9e commented on a change in pull request #11678:
URL: https://github.com/apache/shardingsphere/pull/11678#discussion_r684026192
##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/ShardingSphereProxy.java
##########
@@ -58,20 +54,28 @@
@SneakyThrows(InterruptedException.class)
public void start(final int port) {
try {
- createEventLoopGroup();
- ServerBootstrap bootstrap = new ServerBootstrap();
- initServerBootstrap(bootstrap);
- ChannelFuture future = bootstrap.bind(port).sync();
- startTime = new Date().getTime();
- log.info("ShardingSphere-Proxy start success");
- future.channel().closeFuture().sync();
+ ChannelFuture future = startInternal(port);
+ accept(future);
} finally {
workerGroup.shutdownGracefully();
bossGroup.shutdownGracefully();
BackendExecutorContext.getInstance().getExecutorEngine().close();
}
}
+ private ChannelFuture startInternal(final int port) throws InterruptedException {
+ createEventLoopGroup();
+ ServerBootstrap bootstrap = new ServerBootstrap();
+ initServerBootstrap(bootstrap);
+ ChannelFuture future = bootstrap.bind(port).sync();
+ return future;
Review comment:
ok.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org