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

Method watchdogRequests

projects/JavaScript/proto/proto.js:7089–7102  ·  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

7087 * @param {!number} utc UTC timestamp in milliseconds
7088 */
7089 watchdogRequests (utc) {
7090 for (let [, value] of this._requests_by_timestamp) {
7091 let item = this._requests_by_id.get(value)
7092 let id = value
7093 let timestamp = item[0]
7094 let timespan = item[1]
7095 if ((timestamp + timespan) <= utc) {
7096 let promise = item[2]
7097 promise.reject(new Error('Timeout!'))
7098 this._requests_by_id.delete(id)
7099 this._requests_by_timestamp.delete(timestamp)
7100 }
7101 }
7102 }
7103}
7104
7105exports.Client = Client

Callers 1

watchdogMethod · 0.95

Calls 2

getMethod · 0.45
rejectMethod · 0.45

Tested by

no test coverage detected