* beforeWrite's future is set when the current write may *begin* while satisfying all ordering and pipelining * constraints The return value has no impact on when *subsequent* writes may be consumed from the network and/or * started; that is controlled by afterWrite(). But this code stashes some information which the next call to * afterWrite() uses. */
| 62 | * afterWrite() uses. |
| 63 | */ |
| 64 | Future<Void> ExtConnection::beforeWrite(int desiredPermits) { |
| 65 | if (options.pipelineCompatMode) |
| 66 | return ready(lastWrite); |
| 67 | currentWriteLocked = |
| 68 | lock->take(TaskDefaultYield, std::min(desiredPermits, DOCLAYER_KNOBS->CONNECTION_MAX_PIPELINE_DEPTH / 2)); |
| 69 | return currentWriteLocked; |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * afterWrite()'s return future is set when the next write may be consumed from the network (and beforeWrite() |