UNPKG

3 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.writeToTrackingBuffer = writeToTrackingBuffer;
7const TYPE = {
8 QUERY_NOTIFICATIONS: 1,
9 TXN_DESCRIPTOR: 2,
10 TRACE_ACTIVITY: 3
11};
12const TXNDESCRIPTOR_HEADER_DATA_LEN = 4 + 8;
13const TXNDESCRIPTOR_HEADER_LEN = 4 + 2 + TXNDESCRIPTOR_HEADER_DATA_LEN;
14function writeToTrackingBuffer(buffer, txnDescriptor, outstandingRequestCount) {
15 buffer.writeUInt32LE(0);
16 buffer.writeUInt32LE(TXNDESCRIPTOR_HEADER_LEN);
17 buffer.writeUInt16LE(TYPE.TXN_DESCRIPTOR);
18 buffer.writeBuffer(txnDescriptor);
19 buffer.writeUInt32LE(outstandingRequestCount);
20 const data = buffer.data;
21 data.writeUInt32LE(data.length, 0);
22 return buffer;
23}
24//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJUWVBFIiwiUVVFUllfTk9USUZJQ0FUSU9OUyIsIlRYTl9ERVNDUklQVE9SIiwiVFJBQ0VfQUNUSVZJVFkiLCJUWE5ERVNDUklQVE9SX0hFQURFUl9EQVRBX0xFTiIsIlRYTkRFU0NSSVBUT1JfSEVBREVSX0xFTiIsIndyaXRlVG9UcmFja2luZ0J1ZmZlciIsImJ1ZmZlciIsInR4bkRlc2NyaXB0b3IiLCJvdXRzdGFuZGluZ1JlcXVlc3RDb3VudCIsIndyaXRlVUludDMyTEUiLCJ3cml0ZVVJbnQxNkxFIiwid3JpdGVCdWZmZXIiLCJkYXRhIiwibGVuZ3RoIl0sInNvdXJjZXMiOlsiLi4vc3JjL2FsbC1oZWFkZXJzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBXcml0YWJsZVRyYWNraW5nQnVmZmVyIGZyb20gJy4vdHJhY2tpbmctYnVmZmVyL3dyaXRhYmxlLXRyYW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