void (@NotNull String message, int expectedDownloads) { int currentDownloads = currentDownloadsCount.incrementAndGet(); if (expectedDownloads == 0) { myChannel.writeAndFlush(CmdlineProtoUtil.toMessage(mySessionId, CmdlineProtoUtil.createCacheDownloadMessage(message))); } else { int doubleExpectedDownloads = expectedDownloads * 2 + 1000; myChannel.writeAndFlush(CmdlineProtoUtil.toMessage(mySessionId, CmdlineProtoUtil.createCacheDownloadMessageWithProgress(message, (float)currentDownloads / doubleExpectedDownloads))); } }