MCPcopy Create free account
hub / github.com/ambianic/peerfetch / _ticketProcessed

Method _ticketProcessed

javascript/src/peerfetch.ts:387–405  ·  view source on GitHub ↗

Move on to next pending ticket for the HTTP request queue

(ticket: number)

Source from the content-addressed store, hash-verified

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)

Callers 1

_checkResponseReadyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected