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

Method _enqueueRequest

javascript/src/peerfetch.ts:505–516  ·  view source on GitHub ↗
(request: {})

Source from the content-addressed store, hash-verified

503 }
504
505 _enqueueRequest (request: {}): number {
506 const ticket = this._drawNewTicket()
507 const requestMap = this._requestMap
508 console.debug('_enqueueRequest: ', { requestMap })
509 this._requestMap.set(ticket, { request })
510 if (this._requestMap.size === 1) {
511 // there are no other pending requests
512 // let's send this one on the wire
513 this._sendNextRequest()
514 }
515 return ticket
516 }
517
518 /**
519 Send next pending request to remote peer.

Callers 1

requestMethod · 0.95

Calls 2

_drawNewTicketMethod · 0.95
_sendNextRequestMethod · 0.95

Tested by

no test coverage detected