Using process.nextTick for polling causes way too much cpu usage. Use setTimeout instead