@Override public Mono<? extends Connection> acquire(Bootstrap b) { return Mono.create(sink -> { Bootstrap bootstrap = b.clone(); ChannelOperations.OnSetup factory = BootstrapHandlers.channelOperationFactory(bootstrap); ConnectionObserver obs = BootstrapHandlers.connectionObserver(bootstrap); if (bootstrap.config() .remoteAddress() != null) { convertLazyRemoteAddress(bootstrap); } BootstrapHandlers.finalizeHandler(bootstrap, factory, new NewConnectionObserver(sink, obs)); ChannelFuture f; if (bootstrap.config() .remoteAddress() != null) { f = bootstrap.connect(); } else { f = bootstrap.bind(); } DisposableConnect disposableConnect = new DisposableConnect(sink, f, bootstrap); f.addListener(disposableConnect); sink.onCancel(disposableConnect); }); }
NewConnectionProvider.convertLazyRemoteAddress(bootstrap); ChannelHandler handler = bootstrap.config().handler(); PoolKey holder = new PoolKey(bootstrap.config().remoteAddress(),
@Override public Mono<? extends Connection> acquire(Bootstrap b) { return Mono.create(sink -> { Bootstrap bootstrap = b.clone(); ChannelOperations.OnSetup factory = BootstrapHandlers.channelOperationFactory(bootstrap); ConnectionObserver obs = BootstrapHandlers.connectionObserver(bootstrap); if (bootstrap.config() .remoteAddress() != null) { convertLazyRemoteAddress(bootstrap); } BootstrapHandlers.finalizeHandler(bootstrap, factory, new NewConnectionObserver(sink, obs)); ChannelFuture f; if (bootstrap.config() .remoteAddress() != null) { f = bootstrap.connect(); } else { f = bootstrap.bind(); } DisposableConnect disposableConnect = new DisposableConnect(sink, f, bootstrap); f.addListener(disposableConnect); sink.onCancel(disposableConnect); }); }
NewConnectionProvider.convertLazyRemoteAddress(bootstrap); ChannelHandler handler = bootstrap.config().handler(); PoolKey holder = new PoolKey(bootstrap.config().remoteAddress(),