congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ChannelHandlerContext.newPromise
Code IndexAdd Tabnine to your IDE (free)

How to use
newPromise
method
in
io.netty.channel.ChannelHandlerContext

Best Java code snippets using io.netty.channel.ChannelHandlerContext.newPromise (Showing top 20 results out of 603)

origin: netty/netty

@Override
public ChannelPromise newPromise() {
  return ctx.newPromise();
}
origin: eclipse-vertx/vert.x

@Override
public ChannelPromise newPromise() {
 return ctx.newPromise();
}
origin: redisson/redisson

@Override
public ChannelPromise newPromise() {
  return ctx.newPromise();
}
origin: redisson/redisson

/**
 * Sends an SSL {@code close_notify} message to the specified channel and
 * destroys the underlying {@link SSLEngine}. This will <strong>not</strong> close the underlying
 * {@link Channel}. If you want to also close the {@link Channel} use {@link Channel#close()} or
 * {@link ChannelHandlerContext#close()}
 */
public ChannelFuture closeOutbound() {
  return closeOutbound(ctx.newPromise());
}
origin: redisson/redisson

  @Override
  public void run() {
    // May be done in the meantime as cancel(...) is only best effort.
    if (!flushFuture.isDone()) {
      logger.warn("{} Last write attempt timed out; force-closing the connection.",
          ctx.channel());
      addCloseListener(ctx.close(ctx.newPromise()), promise);
    }
  }
}, closeNotifyTimeout, TimeUnit.MILLISECONDS);
origin: netty/netty

/**
 * Close this {@link Bzip2Encoder} and so finish the encoding.
 *
 * The returned {@link ChannelFuture} will be notified once the operation completes.
 */
public ChannelFuture close() {
  return close(ctx().newPromise());
}
origin: netty/netty

/**
 * Close this {@link Lz4FrameEncoder} and so finish the encoding.
 *
 * The returned {@link ChannelFuture} will be notified once the operation completes.
 */
public ChannelFuture close() {
  return close(ctx().newPromise());
}
origin: netty/netty

@Override
public ChannelFuture close() {
  return close(ctx().newPromise());
}
origin: eclipse-vertx/vert.x

private void _writeGoAway(long errorCode, int lastStreamId, ByteBuf debugData) {
 encoder().writeGoAway(chctx, lastStreamId, errorCode, debugData, chctx.newPromise());
 chctx.flush();
}
origin: eclipse-vertx/vert.x

private void _writeReset(int streamId, long code) {
 encoder().writeRstStream(chctx, streamId, code, chctx.newPromise());
 chctx.flush();
}
origin: redisson/redisson

/**
 * Close this {@link Bzip2Encoder} and so finish the encoding.
 *
 * The returned {@link ChannelFuture} will be notified once the operation completes.
 */
public ChannelFuture close() {
  return close(ctx().newPromise());
}
origin: redisson/redisson

/**
 * Close this {@link Lz4FrameEncoder} and so finish the encoding.
 *
 * The returned {@link ChannelFuture} will be notified once the operation completes.
 */
public ChannelFuture close() {
  return close(ctx().newPromise());
}
origin: redisson/redisson

@Override
public ChannelFuture close() {
  return close(ctx().newPromise());
}
origin: eclipse-vertx/vert.x

private void _writeFrame(Http2Stream stream, byte type, short flags, ByteBuf payload) {
 encoder().writeFrame(chctx, type, stream.id(), new Http2Flags(flags), payload, chctx.newPromise());
 chctx.flush();
}
origin: netty/netty

@Override
public void close(final ChannelHandlerContext ctx, final ChannelPromise promise) throws Exception {
  ChannelFuture f = finishEncode(ctx, ctx.newPromise());
  f.addListener(new ChannelFutureListener() {
    @Override
    public void operationComplete(ChannelFuture f) throws Exception {
      ctx.close(promise);
    }
  });
  if (!f.isDone()) {
    // Ensure the channel is closed even if the write operation completes in time.
    ctx.executor().schedule(new Runnable() {
      @Override
      public void run() {
        ctx.close(promise);
      }
    }, 10, TimeUnit.SECONDS); // FIXME: Magic number
  }
}
origin: eclipse-vertx/vert.x

private void _writePriority(Http2Stream stream, int streamDependency, short weight, boolean exclusive) {
  encoder().writePriority(chctx, stream.id(), streamDependency, weight, exclusive, chctx.newPromise());
}
origin: eclipse-vertx/vert.x

ChannelFuture writePing(long data) {
 ChannelPromise promise = chctx.newPromise();
 EventExecutor executor = chctx.executor();
 if (executor.inEventLoop()) {
  _writePing(data, promise);
 } else {
  executor.execute(() -> {
   _writePing(data, promise);
  });
 }
 return promise;
}
origin: eclipse-vertx/vert.x

ChannelFuture writeSettings(Http2Settings settingsUpdate) {
 ChannelPromise promise = chctx.newPromise();
 EventExecutor executor = chctx.executor();
 if (executor.inEventLoop()) {
  _writeSettings(settingsUpdate, promise);
 } else {
  executor.execute(() -> {
   _writeSettings(settingsUpdate, promise);
  });
 }
 return promise;
}
origin: netty/netty

@Override
public ChannelFuture close(final ChannelPromise promise) {
  ChannelHandlerContext ctx = ctx();
  EventExecutor executor = ctx.executor();
  if (executor.inEventLoop()) {
    return finishEncode(ctx, promise);
  } else {
    final ChannelPromise p = ctx.newPromise();
    executor.execute(new Runnable() {
      @Override
      public void run() {
        ChannelFuture f = finishEncode(ctx(), p);
        f.addListener(new ChannelPromiseNotifier(promise));
      }
    });
    return p;
  }
}
origin: netty/netty

@Override
public ChannelFuture close(final ChannelPromise promise) {
  ChannelHandlerContext ctx = ctx();
  EventExecutor executor = ctx.executor();
  if (executor.inEventLoop()) {
    return finishEncode(ctx, promise);
  } else {
    final ChannelPromise p = ctx.newPromise();
    executor.execute(new Runnable() {
      @Override
      public void run() {
        ChannelFuture f = finishEncode(ctx(), p);
        f.addListener(new ChannelPromiseNotifier(promise));
      }
    });
    return p;
  }
}
io.netty.channelChannelHandlerContextnewPromise

Popular methods of ChannelHandlerContext

  • channel
    Return the Channel which is bound to the ChannelHandlerContext.
  • close
  • writeAndFlush
  • write
  • flush
  • fireChannelRead
  • pipeline
    Return the assigned ChannelPipeline
  • alloc
    Return the assigned ByteBufAllocator which will be used to allocate ByteBufs.
  • executor
    Returns the EventExecutor which is used to execute an arbitrary task.
  • fireExceptionCaught
  • fireUserEventTriggered
  • fireChannelActive
  • fireUserEventTriggered,
  • fireChannelActive,
  • fireChannelInactive,
  • voidPromise,
  • read,
  • fireChannelReadComplete,
  • name,
  • attr,
  • disconnect

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • BoxLayout (javax.swing)
  • JComboBox (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now