private boolean canWrite(final int requiredCapacity) { //evaluate if the write request could be taken: //there is enough space in the write buffer? //The pending writes on event loop will eventually go into the Netty write buffer, hence consider them //as part of the heuristic! final long pendingWritesOnEventLoop = this.pendingWritesOnEventLoop(); final long totalPendingWrites = pendingWritesOnEventLoop + this.pendingWritesOnChannel(); final boolean canWrite; if (requiredCapacity > this.writeBufferHighWaterMark) { canWrite = totalPendingWrites == 0; } else { canWrite = (totalPendingWrites + requiredCapacity) <= this.writeBufferHighWaterMark; } return canWrite; }
private boolean canWrite(final int requiredCapacity) { //evaluate if the write request could be taken: //there is enough space in the write buffer? final long totalPendingWrites = this.pendingWritesOnChannel(); final boolean canWrite; if (requiredCapacity > this.writeBufferHighWaterMark) { canWrite = totalPendingWrites == 0; } else { canWrite = (totalPendingWrites + requiredCapacity) <= this.writeBufferHighWaterMark; } return canWrite; }
private boolean canWrite(final int requiredCapacity) { //evaluate if the write request could be taken: //there is enough space in the write buffer? final long totalPendingWrites = this.pendingWritesOnChannel(); final boolean canWrite; if (requiredCapacity > this.writeBufferHighWaterMark) { canWrite = totalPendingWrites == 0; } else { canWrite = (totalPendingWrites + requiredCapacity) <= this.writeBufferHighWaterMark; } return canWrite; }
private boolean canWrite(final int requiredCapacity) { //evaluate if the write request could be taken: //there is enough space in the write buffer? final long totalPendingWrites = this.pendingWritesOnChannel(); final boolean canWrite; if (requiredCapacity > this.writeBufferHighWaterMark) { canWrite = totalPendingWrites == 0; } else { canWrite = (totalPendingWrites + requiredCapacity) <= this.writeBufferHighWaterMark; } return canWrite; }
private boolean canWrite(final int requiredCapacity) { //evaluate if the write request could be taken: //there is enough space in the write buffer? //The pending writes on event loop will eventually go into the Netty write buffer, hence consider them //as part of the heuristic! final long pendingWritesOnEventLoop = this.pendingWritesOnEventLoop(); final long totalPendingWrites = pendingWritesOnEventLoop + this.pendingWritesOnChannel(); final boolean canWrite; if (requiredCapacity > this.writeBufferHighWaterMark) { canWrite = totalPendingWrites == 0; } else { canWrite = (totalPendingWrites + requiredCapacity) <= this.writeBufferHighWaterMark; } return canWrite; }
private boolean canWrite(final int requiredCapacity) { //evaluate if the write request could be taken: //there is enough space in the write buffer? //The pending writes on event loop will eventually go into the Netty write buffer, hence consider them //as part of the heuristic! final long pendingWritesOnEventLoop = this.pendingWritesOnEventLoop(); final long totalPendingWrites = pendingWritesOnEventLoop + this.pendingWritesOnChannel(); final boolean canWrite; if (requiredCapacity > this.writeBufferHighWaterMark) { canWrite = totalPendingWrites == 0; } else { canWrite = (totalPendingWrites + requiredCapacity) <= this.writeBufferHighWaterMark; } return canWrite; }
private boolean canWrite(final int requiredCapacity) { //evaluate if the write request could be taken: //there is enough space in the write buffer? //The pending writes on event loop will eventually go into the Netty write buffer, hence consider them //as part of the heuristic! final long pendingWritesOnEventLoop = this.pendingWritesOnEventLoop(); final long totalPendingWrites = pendingWritesOnEventLoop + this.pendingWritesOnChannel(); final boolean canWrite; if (requiredCapacity > this.writeBufferHighWaterMark) { canWrite = totalPendingWrites == 0; } else { canWrite = (totalPendingWrites + requiredCapacity) <= this.writeBufferHighWaterMark; } return canWrite; }