[#1669] Correctly notify the ChannelPromise of delayed writes
This commit is contained in:
parent
5e703e7419
commit
0cb3541b53
@ -277,7 +277,7 @@ public abstract class AbstractTrafficShapingHandler extends ChannelDuplexHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(final ChannelHandlerContext ctx, final Object msg, ChannelPromise promise)
|
public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise promise)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
long curtime = System.currentTimeMillis();
|
long curtime = System.currentTimeMillis();
|
||||||
long size = calculateSize(msg);
|
long size = calculateSize(msg);
|
||||||
@ -297,7 +297,7 @@ public abstract class AbstractTrafficShapingHandler extends ChannelDuplexHandler
|
|||||||
ctx.executor().schedule(new Runnable() {
|
ctx.executor().schedule(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
ctx.write(msg);
|
ctx.write(msg, promise);
|
||||||
}
|
}
|
||||||
}, wait, TimeUnit.MILLISECONDS);
|
}, wait, TimeUnit.MILLISECONDS);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user