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

Method watchdogRequests

projects/JavaScript/proto/test.js:25051–25066  ·  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

25049 * @param {!number} utc UTC timestamp in milliseconds
25050 */
25051 watchdogRequests (utc) {
25052 this._protoClient.watchdogRequests(utc)
25053
25054 for (let [, value] of this._requests_by_timestamp) {
25055 let item = this._requests_by_id.get(value)
25056 let id = value
25057 let timestamp = item[0]
25058 let timespan = item[1]
25059 if ((timestamp + timespan) <= utc) {
25060 let promise = item[2]
25061 promise.reject(new Error('Timeout!'))
25062 this._requests_by_id.delete(id)
25063 this._requests_by_timestamp.delete(timestamp)
25064 }
25065 }
25066 }
25067}
25068
25069exports.Client = Client

Callers 2

watchdogMethod · 0.95
watchdogRequestsMethod · 0.45

Calls 2

getMethod · 0.45
rejectMethod · 0.45

Tested by

no test coverage detected