Move on to next pending ticket for the HTTP request queue
(ticket: number)
| 385 | Move on to next pending ticket for the HTTP request queue |
| 386 | */ |
| 387 | _ticketProcessed (ticket: number): void { |
| 388 | const errorMsg = 'response received out of order!' |
| 389 | const nextTicket = this._nextTicketInLine |
| 390 | console.assert( |
| 391 | ticket === nextTicket, |
| 392 | 'ticket parameter has to equal nextTicket', |
| 393 | { ticket, nextTicket, errorMsg } |
| 394 | ) |
| 395 | // remove entry from pending request map |
| 396 | this._requestMap.delete(ticket) |
| 397 | this._nextTicketInLine++ |
| 398 | const nextInLine = this._nextTicketInLine |
| 399 | const nextAvailable = this._nextAvailableTicket |
| 400 | console.assert( |
| 401 | nextInLine <= nextAvailable, |
| 402 | 'nextInLine has to be less or equal than nextAvailable', |
| 403 | { nextInLine, nextAvailable } |
| 404 | ) |
| 405 | } |
| 406 | |
| 407 | /** |
| 408 | * Convenience method for developers familiar with axios.request(config) |