Smart scheduler implementation for node.js