* Creates a new instance of StreamIdStack. * @param {number} version Protocol version * @constructor
(version)
| 66 | * @constructor |
| 67 | */ |
| 68 | constructor(version) { |
| 69 | //Ecmascript Number is 64-bit double, it can be optimized by the engine into a 32-bit int, but nothing below that. |
| 70 | //We try to allocate as few as possible in arrays of 128 |
| 71 | this.currentGroup = generateGroup(0); |
| 72 | this.groupIndex = 0; |
| 73 | this.groups = [this.currentGroup]; |
| 74 | this.releaseTimeout = null; |
| 75 | this.setVersion(version); |
| 76 | /** |
| 77 | * Returns the amount of ids currently in use |
| 78 | * @member {number} |
| 79 | */ |
| 80 | this.inUse = 0; |
| 81 | this.releaseDelay = defaultReleaseDelay; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Sets the protocol version |
nothing calls this directly
no test coverage detected