thejh/node-assertvanish — Issue #1: Does assertvanish find itself in cyclic dependencies?
Author: crickeys
Created: 2012-01-12 01:06:27+00:00
State: open

The following code creates a cyclic assertion. Should it??

io.sockets.on('connection', function (socket) {
// setup listeners for this socket
setup_socket_events(socket);
});

function setup_socket_events(socket)
{
socket.on('disconnect', event_disconnect(socket) );
}
function event_disconnect(socket)
{

return function() {
console.log("disconnect");
// do something with socket
assertvanish(socket, 5000);
}
}