You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to make a little utility to log what's happening in can-connect. I'm working on this now in an effort to debug bitballs.
Posting relevant code:
varconnect=require("can-connect");varWeakReferenceMap=require("can-connect/helpers/weak-reference-map");varWeakReferenceSet=require("can-connect/helpers/weak-reference-set");varsortedSetJSON=require("can-connect/helpers/sorted-set-json");vareventQueue=require("can-event-queue/map/map");// shared across all connectionsvarpendingRequests=0;varnoRequestsTimer=null;varrequests={increment: function(connection){pendingRequests++;clearTimeout(noRequestsTimer);},decrement: function(connection){pendingRequests--;if(pendingRequests===0){// this calls to the connection so that `notifyThereAreNoPendingRequests` can be trappednoRequestsTimer=setTimeout(connection.notifyThereAreNoPendingRequests,module.exports.requestCleanupDelay);}if(pendingRequests<0){pendingRequests=0;}},count: function(){returnpendingRequests;},notifyThereAreNoPendingRequests: function(){requests.dispatch("end");}};eventQueue(requests);varconstructorStore=connect.behavior("constructor/store",function(baseConnection){varbehavior={// do this so this method can be loggednotifyThereAreNoPendingRequests: function(){requests.notifyThereAreNoPendingRequests();},
This is the log function. It nests stack calls. Traps repeat calls over time.
I'd like to make a little utility to log what's happening in can-connect. I'm working on this now in an effort to debug bitballs.
Posting relevant code:
This is the log function. It nests stack calls. Traps repeat calls over time.
The text was updated successfully, but these errors were encountered: