MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / scheduleReconnect

Function scheduleReconnect

www/js/_hyperscript-max.js:11822–11831  ·  view source on GitHub ↗
(stub, baseDelay)

Source from the content-addressed store, hash-verified

11820 }
11821 }
11822 function scheduleReconnect(stub, baseDelay) {
11823 if (stub.closed) return;
11824 baseDelay = baseDelay || 500;
11825 stub.retryCount = Math.min(7, stub.retryCount + 1);
11826 var timeout = Math.random() * 2 ** stub.retryCount * baseDelay;
11827 stub.reconnectTimeout = setTimeout(function() {
11828 stub.reconnectTimeout = null;
11829 if (!stub.closed) startConnection(stub);
11830 }, timeout);
11831 }
11832 function dispatch(stub, eventType, evt) {
11833 for (var i = 0; i < stub.listeners.length; i++) {
11834 var listener = stub.listeners[i];

Callers 2

startConnectionFunction · 0.70
readStreamFunction · 0.70

Calls 2

startConnectionFunction · 0.70
setTimeoutFunction · 0.50

Tested by

no test coverage detected