(options)
| 80 | return true; |
| 81 | } |
| 82 | claim(options) { |
| 83 | if (this.claims.some(claim => claim.host === options.host)) |
| 84 | throw new Error("duplicate"); |
| 85 | |
| 86 | const claim = { |
| 87 | host: options.host, |
| 88 | hostLower: options.host.toLowerCase(), |
| 89 | onReady: options.onReady, |
| 90 | onError: options.onError, |
| 91 | probing: 1, |
| 92 | initial: Timer.set(() => this.probe(claim), 0), |
| 93 | probeAttempt: 1, |
| 94 | }; |
| 95 | this.claims.push(claim); |
| 96 | return claim; |
| 97 | } |
| 98 | unclaim(claim) { |
| 99 | const i = this.claims.indexOf(claim); |
| 100 | if (i < 0) |