MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / watchdogRequests

Method watchdogRequests

projects/JavaScript/proto/protoex.js:7354–7369  ·  view source on GitHub ↗

* Watchdog client requests for timeouts * @this {!Client} * @param {!number} utc UTC timestamp in milliseconds

(utc)

Source from the content-addressed store, hash-verified

7352 * @param {!number} utc UTC timestamp in milliseconds
7353 */
7354 watchdogRequests (utc) {
7355 this._protoClient.watchdogRequests(utc)
7356
7357 for (let [, value] of this._requests_by_timestamp) {
7358 let item = this._requests_by_id.get(value)
7359 let id = value
7360 let timestamp = item[0]
7361 let timespan = item[1]
7362 if ((timestamp + timespan) <= utc) {
7363 let promise = item[2]
7364 promise.reject(new Error('Timeout!'))
7365 this._requests_by_id.delete(id)
7366 this._requests_by_timestamp.delete(timestamp)
7367 }
7368 }
7369 }
7370}
7371
7372exports.Client = Client

Callers 2

watchdogMethod · 0.95
watchdogRequestsMethod · 0.45

Calls 2

getMethod · 0.45
rejectMethod · 0.45

Tested by

no test coverage detected