io.netty.util.concurrent.Promise.getNow()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(254)

本文整理了Java中io.netty.util.concurrent.Promise.getNow()方法的一些代码示例,展示了Promise.getNow()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Promise.getNow()方法的具体详情如下:
包路径:io.netty.util.concurrent.Promise
类名称:Promise
方法名:getNow

Promise.getNow介绍

暂无

代码示例

代码示例来源:origin: redisson/redisson

@Override
public T getNow() {
  return promise.getNow();
}

代码示例来源:origin: redisson/redisson

@Override
public T getNow() {
  return promise.getNow();
}

代码示例来源:origin: line/armeria

@Override
public T getNow() {
  return delegate.getNow();
}

代码示例来源:origin: com.cloudera.livy/livy-rsc

@Override
protected T result() {
 return promise.getNow();
}

代码示例来源:origin: io.netty/netty-testsuite

public void testConnectNotExists(Bootstrap cb) throws Throwable {
    final Promise<Throwable> promise = ImmediateEventExecutor.INSTANCE.newPromise();
    cb.handler(new ChannelInboundHandlerAdapter() {
      @Override
      public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
        promise.trySuccess(cause);
      }
    });
    ChannelFuture future = cb.connect(NetUtil.LOCALHOST, SocketTestPermutation.BAD_PORT);
    try {
      Channel datagramChannel = future.syncUninterruptibly().channel();
      Assert.assertTrue(datagramChannel.isActive());
      datagramChannel.writeAndFlush(
          Unpooled.copiedBuffer("test", CharsetUtil.US_ASCII)).syncUninterruptibly();
      if (!(datagramChannel instanceof OioDatagramChannel)) {
        Assert.assertTrue(promise.syncUninterruptibly().getNow() instanceof PortUnreachableException);
      }
    } finally {
      future.channel().close();
    }
  }
}

代码示例来源:origin: jurmous/etcd4j

/**
 * Handle the promise
 *
 * @param promise to handle
 */
protected void handlePromise(Promise<T> promise) {
 if (!promise.isSuccess()) {
  this.setException(promise.cause());
 } else {
  this.response = promise.getNow();
  if (handlers != null) {
   for (IsSimplePromiseResponseHandler<T> h : handlers) {
    h.onResponse(this);
   }
  }
 }
}

代码示例来源:origin: org.nanoframework/nano-ext-etcd

/**
 * Handle the promise
 *
 * @param promise to handle
 */
protected void handlePromise(Promise<T> promise) {
 if (!promise.isSuccess()) {
  this.setException(promise.cause());
 } else {
  this.response = promise.getNow();
  if (handlers != null) {
   for (IsSimplePromiseResponseHandler<T> h : handlers) {
    h.onResponse(this);
   }
  }
 }
}

代码示例来源:origin: line/centraldogma

plugin = pluginInitPromise.syncUninterruptibly().getNow();

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server-shaded

plugin = pluginInitPromise.syncUninterruptibly().getNow();

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server

plugin = pluginInitPromise.syncUninterruptibly().getNow();

代码示例来源:origin: addthis/hydra

queryEntry.lastSourceInfo = promise.getNow();
if (queryEntry.queryState == QueryState.AGGREGATING) {
  queryEntry.queryState = QueryState.OPS;

相关文章