Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use void promise when sending #1062

Merged
merged 2 commits into from
Dec 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void removeServer(AbstractServer server) {
*/
public void sendResponse(ChannelHandlerContext ctx, CorfuMsg inMsg, CorfuMsg outMsg) {
outMsg.copyBaseFields(inMsg);
ctx.writeAndFlush(outMsg);
ctx.writeAndFlush(outMsg, ctx.voidPromise());
log.trace("Sent response: {}", outMsg);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,9 @@ public <T> CompletableFuture<T> sendMessageAndGetCompletable(ChannelHandlerConte
outstandingRequests.put(thisRequest, cf);
// Write the message out to the channel.
if (ctx == null) {
channel.writeAndFlush(message);
channel.writeAndFlush(message, channel.voidPromise());
} else {
ctx.writeAndFlush(message);
ctx.writeAndFlush(message, ctx.voidPromise());
}
log.trace("Sent message: {}", message);
final CompletableFuture<T> cfElapsed = cf.thenApply(x -> {
Expand Down Expand Up @@ -565,7 +565,7 @@ public void sendMessage(ChannelHandlerContext ctx, CorfuMsg message) {
message.setRequestID(thisRequest);
message.setEpoch(epoch);
// Write this message out on the channel.
outContext.writeAndFlush(message);
outContext.writeAndFlush(message, outContext.voidPromise());
// MetricsUtils.incConditionalCounter(MetricsUtils
// .isMetricsCollectionEnabled(), counterAsyncOpSent, 1);
log.trace("Sent one-way message: {}", message);
Expand All @@ -582,7 +582,7 @@ public void sendMessage(ChannelHandlerContext ctx, CorfuMsg message) {
public void sendResponseToServer(ChannelHandlerContext ctx, CorfuMsg inMsg, CorfuMsg outMsg) {
outMsg.copyBaseFields(inMsg);
outMsg.setEpoch(epoch);
ctx.writeAndFlush(outMsg);
ctx.writeAndFlush(outMsg, ctx.voidPromise());
log.trace("Sent response: {}", outMsg);
}

Expand Down