public async virtual ValueTask <IChannel> AcquireNewOr(long timeout) { IChannel chl; bool b = this.store.TryDequeue(out chl); this.timeout = timeout; if (!b) { Bootstrap bs = this.bootstrap.Clone(); //Bootstrap bs = new Bootstrap(); bs.Attribute(PoolKey, this); log.Debug(" ... try get parent pool channel ... " + parentPool); try { IChannel chnl = await parentPool.AcquireAsync(); log.Debug(" ... Channel " + chnl); await ConnectChannel(chnl, timeout); return(chnl); } catch (Exception e) { log.Error("Something went wromg here: .. " + e.Message); } return(null); } IEventLoop eventLoop = chl.EventLoop; if (eventLoop.InEventLoop) { return(await this.DoHealthCheck(chl, timeout)); } else { var completionSource = new TaskCompletionSource <IChannel>(); eventLoop.Execute(this.DoHealthCheck, chl, completionSource); return(await completionSource.Task); } // return acquire(bootstrap.Config().group().next().newPromise<IChannel>()); }