Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | 41x 41x 41x 41x 41x 41x 41x 346x 346x 346x 346x 346x 346x 346x 346x 346x 346x 346x 41x 41x 60x 60x 60x 41x 41x 60x 60x 60x 60x 3x 3x 60x 60x 60x 60x 60x 60x 60x 60x 41x 41x 41x 41x 27x 14x 14x 13x 13x 27x 3x 3x 3x 3x 3x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 27x 3x 3x 13x 27x 41x 41x 335x 335x 41x | // Copyright (c) ZeroC, Inc. import { Protocol } from "./Protocol.js"; import { OutputStream } from "./OutputStream.js"; export class BatchRequestQueue { constructor(instance) { this._batchRequestNum = 0; this._batchStream = new OutputStream( Protocol.currentProtocolEncoding, instance.defaultsAndOverrides().defaultFormat, ); this._batchStream.writeBlob(Protocol.requestBatchHdr); this._batchMarker = this._batchStream.size; this._exception = null; this._maxSize = instance.batchAutoFlushSize(); } prepareBatchRequest(os) { if (this._exception) { throw this._exception; } this._batchStream.swap(os); } finishBatchRequest(os, proxy) { this._batchStream.swap(os); try { if (this._maxSize > 0 && this._batchStream.size >= this._maxSize) { proxy.ice_flushBatchRequests(); // Auto flush } console.assert(this._batchMarker < this._batchStream.size); this._batchMarker = this._batchStream.size; ++this._batchRequestNum; } finally { this._batchStream.resize(this._batchMarker); } } abortBatchRequest(os) { this._batchStream.swap(os); this._batchStream.resize(this._batchMarker); } swap(os) { if (this._batchRequestNum === 0) { return 0; } let lastRequest = null; if (this._batchMarker < this._batchStream.size) { const length = this._batchStream.size - this._batchMarker; this._batchStream.pos = this._batchMarker; lastRequest = this._batchStream.buffer.getArray(length); this._batchStream.resize(this._batchMarker); } const requestNum = this._batchRequestNum; this._batchStream.swap(os); // // Reset the batch. // this._batchRequestNum = 0; this._batchStream.writeBlob(Protocol.requestBatchHdr); this._batchMarker = this._batchStream.size; if (lastRequest !== null) { this._batchStream.writeBlob(lastRequest); } return requestNum; } destroy(ex) { this._exception = ex; } } |