ChannelFuture future = (ChannelFuture) futures.get(i); if (future.isDone()) { recordException(future);
ctx.fireChannelRead(out.get(i));
ChannelFuture future = (ChannelFuture) futures.get(i); if (future.isDone()) { recordException(future);
ChannelFuture future = (ChannelFuture) futures.get(i); if (future.isDone()) { recordException(future);
Object nextItem = buffer.get(currentBufferIndex++);
public void sendMessages(ChannelHandlerContext ctx, RecyclableArrayList messages) { Channel channel = ctx.channel(); channel.eventLoop().execute(() -> { int i = 0; while (channel.isActive() && channel.isWritable() && i < messages.size()) { for (int j = 0; j < 5 && i < messages.size(); j++, i++) { ctx.write(messages.get(i), ctx.voidPromise()); } ctx.flush(); } if (i < messages.size()) { messages.subList(0, i).clear(); storeMessages(ctx.name(), messages); } else { messages.recycle(); } }); }
final int n = instance.size() - 1; if (n == 0) { channelHandlerContext.write(instance.get(0), channelPromise); } else if (n > 0) { ChannelPromise voidPromise = channelHandlerContext.voidPromise(); promise = channelHandlerContext.newPromise(); channelHandlerContext.write(instance.get(i), promise); channelHandlerContext.write(instance.get(n), channelPromise);
if(server4WwwHandler.getCacheKey()!=null && out.get(0) instanceof HttpMessage){ //提炼出last_modified CharSequence lastModifiedHeader = ((HttpMessage)out.get(0)).headers().get(HttpHeader.LAST_MODIFIED.asString()) ; long lastModified = CacheManager.getDateField(lastModifiedHeader==null?null:lastModifiedHeader.toString()); server4WwwHandler.setLastModified(lastModified==-1? new Date().getTime():lastModified); if(server4WwwHandler.getCacheKey()!=null && !out.isEmpty() && out.get(out.size()-1) instanceof LastHttpContent){ CacheManager cacheManager = StartSEngine.getApplicationContext().getBean(CacheManager.class); cacheManager.addCache(server4WwwHandler.getUserDomain(), server4WwwHandler.getCacheKey(), server4WwwHandler.getUri(),server4WwwHandler.getLastModified(), server4WwwHandler.getBaos().toByteArray()); final int sizeMinusOne = out.size() - 1; if (sizeMinusOne == 0) { ctx.write(out.get(0), promise); } else if (sizeMinusOne > 0) { p = ctx.newPromise(); ctx.write(out.get(i), p); ctx.write(out.get(sizeMinusOne), promise);
ctx.fireChannelRead(out.get(i));
ctx.fireChannelRead(out.get(i));
ChannelFuture future = (ChannelFuture) futures.get(i); if (future.isDone()) { recordException(future);
ChannelFuture future = (ChannelFuture) futures.get(i); if (future.isDone()) { recordException(future);
ChannelFuture future = (ChannelFuture) futures.get(i); if (future.isDone()) { recordException(future);