MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / add

Method add

modules/network/dns/dnsresolverudp.js:49–59  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

47 this.timer = Timer.repeat(this.task.bind(this), 1000);
48 }
49 add(request) {
50 request.state = 0;
51 request.id = request.host.endsWith(".local") ? 0 : ((Math.random() * 65535) | 1);
52 this.requests.push(request);
53
54 try {
55 this.send(request);
56 }
57 catch {
58 }
59 }
60 remove(request) {
61 for (let i = 0; i < this.requests.length; i++) {
62 if (this.requests[i].request === request) {

Callers

nothing calls this directly

Calls 2

sendMethod · 0.95
pushMethod · 0.45

Tested by

no test coverage detected